From 713d6e3dd3473e72fe72d42f3f7b8c07b5ed2616 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 26 Aug 2004 22:26:26 +0000 Subject: Save a line or two --- loginutils/getty.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'loginutils/getty.c') 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); } -- cgit v1.2.3