فهرست منبع

fix fcntl() call so that it actually forces file to be closed on exec()

Mike Frysinger 20 سال پیش
والد
کامیت
49dd969022
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      libc/misc/utmp/utent.c

+ 1 - 1
libc/misc/utmp/utent.c

@@ -60,7 +60,7 @@ void setutent(void)
 	/* Make sure the file will be closed on exec()  */
 	/* Make sure the file will be closed on exec()  */
 	ret = fcntl(static_fd, F_GETFD, 0);
 	ret = fcntl(static_fd, F_GETFD, 0);
 	if (ret >= 0) {
 	if (ret >= 0) {
-	    ret = fcntl(static_fd, F_GETFD, 0);
+	    ret = fcntl(static_fd, F_SETFD, ret | FD_CLOEXEC);
 	}
 	}
 	if (ret < 0) {
 	if (ret < 0) {
 bummer:
 bummer: