Module Name:    src
Committed By:   pooka
Date:           Thu Aug  6 00:20:45 UTC 2009

Modified Files:
        src/libexec/lfs_cleanerd: lfs_cleanerd.c

Log Message:
add -D, which prompts to stay on foreground without debug spewage


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/libexec/lfs_cleanerd/lfs_cleanerd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/libexec/lfs_cleanerd/lfs_cleanerd.c
diff -u src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.18 src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.19
--- src/libexec/lfs_cleanerd/lfs_cleanerd.c:1.18	Thu Aug  6 00:05:01 2009
+++ src/libexec/lfs_cleanerd/lfs_cleanerd.c	Thu Aug  6 00:20:45 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_cleanerd.c,v 1.18 2009/08/06 00:05:01 pooka Exp $	 */
+/* $NetBSD: lfs_cleanerd.c,v 1.19 2009/08/06 00:20:45 pooka Exp $	 */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -1315,7 +1315,7 @@
 int
 main(int argc, char **argv)
 {
-	int i, opt, error, r, loopcount;
+	int i, opt, error, r, loopcount, nodetach;
 	struct timeval tv;
 	CLEANERINFO ci;
 #ifndef USE_CLIENT_SERVER
@@ -1331,6 +1331,7 @@
 	stat_report	= 0;
 	inval_segment	= -1;
 	copylog_filename = NULL;
+	nodetach        = 0;
 
 	/*
 	 * Parse command-line arguments
@@ -1347,8 +1348,12 @@
 			    do_coalesce++;
 			    break;
 		    case 'd':	/* Debug mode. */
+			    nodetach++;
 			    debug++;
 			    break;
+		    case 'D':	/* stay-on-foreground */
+			    nodetach++;
+			    break;
 		    case 'f':	/* Use fs idle time rather than cpu idle */
 			    use_fs_idle = 1;
 			    break;
@@ -1397,9 +1402,9 @@
 	}
 
 	/*
-	 * Set up daemon mode or verbose debug mode
+	 * Set up daemon mode or foreground mode
 	 */
-	if (debug) {
+	if (nodetach) {
 		openlog("lfs_cleanerd", LOG_NDELAY | LOG_PID | LOG_PERROR,
 			LOG_DAEMON);
 		signal(SIGINT, sig_report);

Reply via email to