[Pkg-shadow-commits] r2084 - in upstream/trunk: . src

nekral-guest at alioth.debian.org nekral-guest at alioth.debian.org
Mon Jun 9 20:02:47 UTC 2008


Author: nekral-guest
Date: 2008-06-09 20:02:46 +0000 (Mon, 09 Jun 2008)
New Revision: 2084

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/src/logoutd.c
Log:
	* src/logoutd.c: Use a bool when possible instead of int integers.
	* src/logoutd.c: Avoid implicit conversion of pointers / integers
	/ chars to booleans.
	* src/logoutd.c: Ignore return value of setlocale(),
	bindtextdomain(), and textdomain().
	* src/logoutd.c: Add brackets and parenthesis.


Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2008-06-09 19:46:11 UTC (rev 2083)
+++ upstream/trunk/ChangeLog	2008-06-09 20:02:46 UTC (rev 2084)
@@ -1,5 +1,14 @@
 2008-06-09  Nicolas François  <nicolas.francois at centraliens.net>
 
+	* src/logoutd.c: Use a bool when possible instead of int integers.
+	* src/logoutd.c: Avoid implicit conversion of pointers / integers
+	/ chars to booleans.
+	* src/logoutd.c: Ignore return value of setlocale(),
+	bindtextdomain(), and textdomain().
+	* src/logoutd.c: Add brackets and parenthesis.
+
+2008-06-09  Nicolas François  <nicolas.francois at centraliens.net>
+
 	* src/chpasswd.c: Use a bool when possible instead of int
 	integers.
 	* src/chpasswd.c: Avoid implicit conversion of pointers / integers

Modified: upstream/trunk/src/logoutd.c
===================================================================
--- upstream/trunk/src/logoutd.c	2008-06-09 19:46:11 UTC (rev 2083)
+++ upstream/trunk/src/logoutd.c	2008-06-09 20:02:46 UTC (rev 2084)
@@ -82,8 +82,9 @@
 	/*
 	 * Check if they are allowed to be logged in right now.
 	 */
-	if (!isttytime (user, ut->ut_line, now))
+	if (!isttytime (user, ut->ut_line, now)) {
 		return 0;
+	}
 	return 1;
 }
 
@@ -92,11 +93,13 @@
 {
 	TERMIO oldt, newt;
 	FILE *mesg_file, *tty_file;
-	int c, is_tty;
+	int c;
+	bool is_tty;
 
 	tty_file = fdopen (tty_fd, "w");
-	if (!tty_file)
+	if (NULL == tty_file) {
 		return;
+	}
 
 	is_tty = (GTTY (tty_fd, &oldt) == 0);
 	if (is_tty) {
@@ -108,10 +111,11 @@
 	}
 
 	mesg_file = fopen (HUP_MESG_FILE, "r");
-	if (mesg_file) {
+	if (NULL != mesg_file) {
 		while ((c = getc (mesg_file)) != EOF) {
-			if (c == '\n')
+			if (c == '\n') {
 				putc ('\r', tty_file);
+			}
 			putc (c, tty_file);
 		}
 		fclose (mesg_file);
@@ -150,9 +154,9 @@
 	char tty_name[sizeof (ut->ut_line) + 6];	/* /dev/ + NUL */
 	int tty_fd;
 
-	setlocale (LC_ALL, "");
-	bindtextdomain (PACKAGE, LOCALEDIR);
-	textdomain (PACKAGE);
+	(void) setlocale (LC_ALL, "");
+	(void) bindtextdomain (PACKAGE, LOCALEDIR);
+	(void) textdomain (PACKAGE);
 
 #ifndef DEBUG
 	for (i = 0; close (i) == 0; i++);
@@ -184,7 +188,7 @@
 	 * Scan the utmpx/utmp file once per minute looking for users that
 	 * are not supposed to still be logged in.
 	 */
-	while (1) {
+	while (true) {
 
 		/* 
 		 * Attempt to re-open the utmpx/utmp file. The file is only
@@ -202,16 +206,19 @@
 		 * is permitted to be signed on at this time.
 		 */
 #if HAVE_UTMPX_H
-		while ((ut = getutxent ())) {
+		while ((ut = getutxent ()) != NULL) {
 #else
-		while ((ut = getutent ())) {
+		while ((ut = getutent ()) != NULL) {
 #endif
-			if (ut->ut_type != USER_PROCESS)
+			if (ut->ut_type != USER_PROCESS) {
 				continue;
-			if (ut->ut_user[0] == '\0')
+			}
+			if (ut->ut_user[0] == '\0') {
 				continue;
-			if (check_login (ut))
+			}
+			if (check_login (ut)) {
 				continue;
+			}
 
 			/*
 			 * Put the rest of this in a child process. This
@@ -228,10 +235,11 @@
 			}
 			/* child */
 
-			if (strncmp (ut->ut_line, "/dev/", 5) != 0)
+			if (strncmp (ut->ut_line, "/dev/", 5) != 0) {
 				strcpy (tty_name, "/dev/");
-			else
+			} else {
 				tty_name[0] = '\0';
+			}
 
 			strcat (tty_name, ut->ut_line);
 #ifndef O_NOCTTY
@@ -281,3 +289,4 @@
 	return 1;
 	/* NOT REACHED */
 }
+




More information about the Pkg-shadow-commits mailing list