mirror of
https://github.com/troglobit/finit.git
synced 2026-11-28 20:58:24 +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
+2
-1
@@ -333,7 +333,8 @@ static void fs_mount_all(void)
|
|||||||
_d("Calling extra mount hook, after mount -a ...");
|
_d("Calling extra mount hook, after mount -a ...");
|
||||||
plugin_run_hooks(HOOK_MOUNT_POST);
|
plugin_run_hooks(HOOK_MOUNT_POST);
|
||||||
|
|
||||||
run("swapon -ea", "swapon");
|
if (whichp("swapon"))
|
||||||
|
run("swapon -ea", "swapon");
|
||||||
|
|
||||||
_d("Finalize, ensure common file systems are available ...");
|
_d("Finalize, ensure common file systems are available ...");
|
||||||
fs_finalize();
|
fs_finalize();
|
||||||
|
|||||||
@@ -321,7 +321,8 @@ void do_shutdown(shutop_t op)
|
|||||||
|
|
||||||
/* Unmount any tmpfs before unmounting swap ... */
|
/* Unmount any tmpfs before unmounting swap ... */
|
||||||
unmount_tmpfs();
|
unmount_tmpfs();
|
||||||
run("swapoff -e -a", "swapoff");
|
if (whichp("swapoff"))
|
||||||
|
run("swapoff -e -a", "swapoff");
|
||||||
|
|
||||||
/* ... unmount remaining regular file systems. */
|
/* ... unmount remaining regular file systems. */
|
||||||
unmount_regular();
|
unmount_regular();
|
||||||
|
|||||||
Reference in new issue
Block a user