Remove unnecessary use of fork and pipes
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,
- One process was needlessly blocking, it was doing no work, and finally waited for the other to end
- The other process is doing everything non-concurrently (synchronously)
Other minor changes:
-
Changed name of
daemon
function tomount_disk
-
Added some comments to
mount_disk
Notes:
- 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)
- Removes two usages of
unsafe
Fixes #40 (closed)
Edited by Aditya Gupta