summaryrefslogtreecommitdiff
path: root/login.c
diff options
context:
space:
mode:
Diffstat (limited to 'login.c')
-rw-r--r--login.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/login.c b/login.c
index f95cbcee8..29259f511 100644
--- a/login.c
+++ b/login.c
@@ -18,7 +18,7 @@
18 */ 18 */
19 19
20#include "includes.h" 20#include "includes.h"
21RCSID("$Id: login.c,v 1.18 2000/01/14 04:45:50 damien Exp $"); 21RCSID("$Id: login.c,v 1.19 2000/01/23 09:18:36 damien Exp $");
22 22
23#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX) 23#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
24# include <utmpx.h> 24# include <utmpx.h>
@@ -58,20 +58,20 @@ get_last_login_time(uid_t uid, const char *logname,
58 char *lastlog; 58 char *lastlog;
59 int fd; 59 int fd;
60#ifdef LASTLOG_IS_DIR 60#ifdef LASTLOG_IS_DIR
61 char buf[1024]; 61 char lbuf[1024];
62#endif /* LASTLOG_IS_DIR */ 62#endif /* LASTLOG_IS_DIR */
63 63
64 lastlog = _PATH_LASTLOG; 64 lastlog = _PATH_LASTLOG;
65 buf[0] = '\0'; 65 buf[0] = '\0';
66 66
67#ifdef LASTLOG_IS_DIR 67#ifndef LASTLOG_IS_DIR
68 fd = open(lastlog, O_RDONLY); 68 fd = open(lastlog, O_RDONLY);
69 if (fd < 0) 69 if (fd < 0)
70 return 0; 70 return 0;
71 lseek(fd, (off_t) ((long) uid * sizeof(ll)), SEEK_SET); 71 lseek(fd, (off_t) ((long) uid * sizeof(ll)), SEEK_SET);
72#else /* LASTLOG_IS_DIR */ 72#else /* LASTLOG_IS_DIR */
73 snprintf(buf, sizeof(buf), "%s/%s", lastlog, logname); 73 snprintf(lbuf, sizeof(buf), "%s/%s", lastlog, logname);
74 fd = open(buf, O_RDONLY); 74 fd = open(lbuf, O_RDONLY);
75 if (fd < 0) 75 if (fd < 0)
76 return 0; 76 return 0;
77#endif /* LASTLOG_IS_DIR */ 77#endif /* LASTLOG_IS_DIR */