mirror of
https://github.com/troglobit/finit.git
synced 2026-10-20 11:19:35 +00:00
Only run swapon/swapoff if they exist
To silence warnings at startup/shutdown, check for existance of swapon and swapoff before calling them. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
f7a1514131
commit
0e695aa0c7
2 files changed
+4
-2
No files matched your search
@@ -321,7 +321,8 @@ void do_shutdown(shutop_t op)
|
||||
|
||||
/* Unmount any tmpfs before unmounting swap ... */
|
||||
unmount_tmpfs();
|
||||
run("swapoff -e -a", "swapoff");
|
||||
if (whichp("swapoff"))
|
||||
run("swapoff -e -a", "swapoff");
|
||||
|
||||
/* ... unmount remaining regular file systems. */
|
||||
unmount_regular();
|
||||
|
||||
Reference in new issue
Block a user