Skip to content

Remove unnecessary use of fork and pipes

Aditya Gupta requested to merge adi-g15/redoxfs:fork_pipe into master

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