[hackers] [skvm] Make sure to cleanup after /etc/fstab after catching a SIGTERM. || Dimitrios Papastamos

From: <hg_AT_suckless.org>
Date: Sun, 31 May 2009 10:19:33 +0000 (UTC)

changeset: 18:9ba2a1bcd7bc
tag: tip
user: Dimitrios Papastamos <stateless [at] archlinux.us>
date: Sun May 31 11:19:33 2009 -0700
files: skvm.c
description:
Make sure to cleanup after /etc/fstab after catching a SIGTERM.

diff -r b05eb5f85ad9 -r 9ba2a1bcd7bc skvm.c
--- a/skvm.c Tue May 19 19:03:05 2009 -0700
+++ b/skvm.c Sun May 31 11:19:33 2009 -0700
@@ -187,6 +187,7 @@
    loop = g_main_loop_new((GMainContext *)NULL, FALSE);
    g_main_run(loop);
 
+ printf("received SIGTERM\n");
    deinit();
    return EXIT_SUCCESS;
 }
@@ -268,6 +269,12 @@
 
    while (iter) {
       tmp = iter;
+ if (!is_mounted(iter->dev))
+ /* don't care to check the return values */
+ do_umount(iter);
+ rmdir(iter->mountp);
+ if (iter->should_remove_entry)
+ remove_fstab_entry(iter);
       iter = iter->next;
       free_device(tmp);
    }
Received on Sun May 31 2009 - 10:19:33 UTC

This archive was generated by hypermail 2.2.0 : Sun May 31 2009 - 10:24:06 UTC