svn commit: trunk/busybox: loginutils mailutils

vda at busybox.net vda at busybox.net
Fri Nov 7 01:12:16 UTC 2008


Author: vda
Date: 2008-11-06 17:12:16 -0800 (Thu, 06 Nov 2008)
New Revision: 23951

Log:
login: fix /etc/nologin support
build system: fix config warnings ("Overlong line")

function                                             old     new   delta
login_main                                          1735    1774     +39
__libc_tcdrain                                         -      23     +23
------------------------------------------------------------------------------
(add/remove: 1/0 grow/shrink: 1/0 up/down: 62/0)               Total: 62 bytes



Modified:
   trunk/busybox/loginutils/login.c
   trunk/busybox/mailutils/Config.in


Changeset:
Modified: trunk/busybox/loginutils/login.c
===================================================================
--- trunk/busybox/loginutils/login.c	2008-11-06 23:42:42 UTC (rev 23950)
+++ trunk/busybox/loginutils/login.c	2008-11-07 01:12:16 UTC (rev 23951)
@@ -118,18 +118,25 @@
 {
 	FILE *fp;
 	int c;
+	int empty = 1;
 
-	if (access("/etc/nologin", F_OK))
+	fp = fopen_for_read("/etc/nologin");
+	if (!fp) /* assuming it does not exist */
 		return;
 
-	fp = fopen_for_read("/etc/nologin");
-	if (fp) {
-		while ((c = getc(fp)) != EOF)
-			bb_putchar((c=='\n') ? '\r' : c);
-		fflush(stdout);
-		fclose(fp);
-	} else
+	while ((c = getc(fp)) != EOF) {
+		if (c == '\n')
+			bb_putchar('\r');
+		bb_putchar(c);
+		empty = 0;
+	}
+	if (empty)
 		puts("\r\nSystem closed for routine maintenance\r");
+
+	fclose(fp);
+	fflush(NULL);
+	/* Users say that they do need this prior to exit: */
+	tcdrain(STDOUT_FILENO);
 	exit(EXIT_FAILURE);
 }
 #else

Modified: trunk/busybox/mailutils/Config.in
===================================================================
--- trunk/busybox/mailutils/Config.in	2008-11-06 23:42:42 UTC (rev 23950)
+++ trunk/busybox/mailutils/Config.in	2008-11-07 01:12:16 UTC (rev 23951)
@@ -17,15 +17,18 @@
 	bool "popmaildir"
 	default n
 	help
-	  Simple yet powerful POP3 mail popper. Delivers content of remote mailboxes to local Maildir.
+	  Simple yet powerful POP3 mail popper. Delivers content
+	  of remote mailboxes to local Maildir.
 
 config FEATURE_POPMAILDIR_DELIVERY
 	bool "Allow message filters and custom delivery program"
 	default n
 	depends on POPMAILDIR
 	help
-	  Allow to use a custom program to filter the content of the message before actual delivery (-F "prog [args...]").
-	  Allow to use a custom program for message actual delivery (-M "prog [args...]").
+	  Allow to use a custom program to filter the content
+	  of the message before actual delivery (-F "prog [args...]").
+	  Allow to use a custom program for message actual delivery
+	  (-M "prog [args...]").
 
 config REFORMIME
 	bool "reformime"
@@ -38,7 +41,8 @@
 	default y
 	depends on REFORMIME
 	help
-	  Accept (for compatibility only) and ignore options other than -x and -X.
+	  Accept (for compatibility only) and ignore options
+	  other than -x and -X.
 
 config SENDMAIL
 	bool "sendmail"
@@ -59,6 +63,7 @@
 	default n
 	depends on FEATURE_SENDMAIL_MAILX
 	help
-	  Allow to specify Cc: addresses and some additional headers: Errors-To:.
+	  Allow to specify Cc: addresses and some additional headers:
+	  Errors-To:
 
 endmenu




More information about the busybox-cvs mailing list