summaryrefslogtreecommitdiff
path: root/loginutils/login.c
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils/login.c')
-rw-r--r--loginutils/login.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index f5e950f..4786d11 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -479,7 +479,8 @@ static void setutmp(const char *name, const char *line)
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);
}