aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorGravatar Eric Andersen <andersen@codepoet.org>2004-08-26 22:26:26 +0000
committerGravatar Eric Andersen <andersen@codepoet.org>2004-08-26 22:26:26 +0000
commit713d6e3dd3473e72fe72d42f3f7b8c07b5ed2616 (patch)
tree4c691d30c0dacf25eba51b55cb2e782bb47d2920 /loginutils
parent97a1de10e95c44e1a2cec3c3c4fd8b39d4219318 (diff)
downloadbusybox-713d6e3dd3473e72fe72d42f3f7b8c07b5ed2616.tar.gz
busybox-713d6e3dd3473e72fe72d42f3f7b8c07b5ed2616.tar.bz2
Save a line or two
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/getty.c6
-rw-r--r--loginutils/login.c3
2 files changed, 3 insertions, 6 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 4d8aa9e31..923432ba1 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -504,8 +504,7 @@ static void update_utmp(char *line)
* 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 @@ static void update_utmp(char *line)
{
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);
}
diff --git a/loginutils/login.c b/loginutils/login.c
index 4786d117d..f3630f102 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -479,8 +479,7 @@ static void setutmp(const char *name, const char *line)
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);
}