浏览代码

Richard June <rjune@bravegnuworld.com> noticed that setutent
was only opening utmp readonly. Oops.

Eric Andersen 23 年之前
父节点
当前提交
810ad656d6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      libc/misc/utmp/utent.c

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

@@ -32,7 +32,7 @@ void setutent(void)
 {
 {
 	if (ut_fd != -1)
 	if (ut_fd != -1)
 		close(ut_fd);
 		close(ut_fd);
-	if ((ut_fd = open(ut_name, O_RDONLY)) < 0) {
+	if ((ut_fd = open(ut_name, O_RDWR)) < 0) {
 		ut_fd = -1;
 		ut_fd = -1;
 	}
 	}
 }
 }