summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorpooka <pooka@NetBSD.org>2010-08-16 22:11:55 +0000
committerpooka <pooka@NetBSD.org>2010-08-16 22:11:55 +0000
commit0fb1ef7452eefc2f354f34b553def56dfebe298a (patch)
tree157436709cdc6a3268a018be9d6103d5647483a5 /libexec
parentf3e239e7c7b379f2114c8f3b39d8e8d256f92809 (diff)
Don't exit when running as a lib after FS is unmounted, just return
from the mainloop.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/lfs_cleanerd/lfs_cleanerd.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/libexec/lfs_cleanerd/lfs_cleanerd.c b/libexec/lfs_cleanerd/lfs_cleanerd.c
index 5b44da99d7e..500729ac5c5 100644
--- a/libexec/lfs_cleanerd/lfs_cleanerd.c
+++ b/libexec/lfs_cleanerd/lfs_cleanerd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_cleanerd.c,v 1.25 2010/07/29 14:09:45 pooka Exp $ */
+/* $NetBSD: lfs_cleanerd.c,v 1.26 2010/08/16 22:11:55 pooka Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -1543,6 +1543,7 @@ lfs_cleaner_main(int argc, char **argv)
if (semaddr)
sem_post(semaddr);
#endif
+ error = 0;
while (nfss > 0) {
int cleaned_one;
do {
@@ -1581,11 +1582,17 @@ lfs_cleaner_main(int argc, char **argv)
handle_error(fsp, i);
assert(nfss == 0);
}
- } else
+ } else {
+#ifdef LFS_CLEANER_AS_LIB
+ error = ESHUTDOWN;
+ break;
+#else
err(1, "LFCNSEGWAITALL");
+#endif
+ }
}
}
/* NOTREACHED */
- return 0;
+ return error;
}