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

Glenn McGrath bug1 at codepoet.org
Wed Aug 25 02:02:20 UTC 2004


    Date: Tuesday, August 24, 2004 @ 20:02:19
  Author: bug1
    Path: /var/cvs/busybox/loginutils

Modified: getty.c (1.13 -> 1.14) login.c (1.19 -> 1.20)

Patch from Manousaridis Angelos to cleanup stale file descriptors, it was preventing unmounting an initial filesystem.


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



More information about the busybox-cvs mailing list