[BusyBox-cvs] CVS update of busybox/loginutils (getty.c login.c)

Erik Andersen andersen at codepoet.org
Thu Aug 26 22:26:27 UTC 2004


    Date: Thursday, August 26, 2004 @ 16:26:27
  Author: andersen
    Path: /var/cvs/busybox/loginutils

Modified: getty.c (1.14 -> 1.15) login.c (1.20 -> 1.21)

Save a line or two


Index: busybox/loginutils/getty.c
diff -u busybox/loginutils/getty.c:1.14 busybox/loginutils/getty.c:1.15
--- busybox/loginutils/getty.c:1.14	Tue Aug 24 20:02:19 2004
+++ busybox/loginutils/getty.c	Thu Aug 26 16:26:26 2004
@@ -504,8 +504,7 @@
 	 * entry in the utmp file.
 	 */
 	if (access(_PATH_UTMP, R_OK|W_OK) == -1) {
-		int fd = creat(_PATH_UTMP, 0664);
-		close(fd);
+		close(creat(_PATH_UTMP, 0664));
 	}
 	utmpname(_PATH_UTMP);
 	setutent();
@@ -536,8 +535,7 @@
 
 	{
 		if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
-			int fd = creat(_PATH_WTMP, 0664);
-			close(fd);
+			close(creat(_PATH_WTMP, 0664));
 		}
 		updwtmp(_PATH_WTMP, &ut);
 	}
Index: busybox/loginutils/login.c
diff -u busybox/loginutils/login.c:1.20 busybox/loginutils/login.c:1.21
--- busybox/loginutils/login.c:1.20	Tue Aug 24 20:02:19 2004
+++ busybox/loginutils/login.c	Thu Aug 26 16:26:26 2004
@@ -479,8 +479,7 @@
 	pututline(&utent);
 	endutent();
 	if (access(_PATH_WTMP, R_OK|W_OK) == -1) {
-		int fd = creat(_PATH_WTMP, 0664);
-		close(fd);
+		close(creat(_PATH_WTMP, 0664));
 	}
 	updwtmp(_PATH_WTMP, &utent);
 }



More information about the busybox-cvs mailing list