Skip to content
Snippets Groups Projects

Remove unnecessary use of fork and pipes

Closed Aditya Gupta requested to merge adi-g15/redoxfs:fork_pipe into master
1 unresolved thread

Previously, we created a pipe, and then forked, then in one process we block on a read, while in other process, AFTER it completes, it does a write on the write end of the pipe, and hence it + the process blocking on read end of the pipe will both exit.

So, the pipes and fork can be removed because,

  1. One process was needlessly blocking, it was doing no work, and finally waited for the other to end
  2. The other process is doing everything non-concurrently (synchronously)

Other minor changes:

  1. Changed name of daemon function to mount_disk

  2. Added some comments to mount_disk

Notes:

  1. Still following the process::exit pattern, though I think that's not needed now, can just return a Result from main() itself, instead of explicitly using process::exit(0) and process::exit(1)
  2. Removes two usages of unsafe

Fixes #40 (closed)

Edited by Aditya Gupta

Merge request reports

Pipeline #10078 failed

Pipeline failed for bbdaba45 on adi-g15:fork_pipe

Approval is optional

Closed by Jeremy SollerJeremy Soller 2 years ago (Mar 18, 2022 7:42pm UTC)

Merge details

  • The changes were not merged into master.

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply