summaryrefslogtreecommitdiff
path: root/sysutils/doinkd/files/utmpx-idled.c
diff options
context:
space:
mode:
authorWen Heping <wen@FreeBSD.org>2010-02-02 06:03:37 +0000
committerWen Heping <wen@FreeBSD.org>2010-02-02 06:03:37 +0000
commitd2253bb205f27fb8ad3e14d2c967046c20cbcf20 (patch)
treeccafbbb2149744ec2c7d11a8d7ad8b8402a18c6e /sysutils/doinkd/files/utmpx-idled.c
parent- Update to 3.1.2 (diff)
- Convert from utmp.h to utmpx.h
PR: ports/143238 Submitted by: Rob Farmer <rfarmer@predatorlabs.net>
Notes
Notes: svn path=/head/; revision=249070
Diffstat (limited to 'sysutils/doinkd/files/utmpx-idled.c')
-rw-r--r--sysutils/doinkd/files/utmpx-idled.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/sysutils/doinkd/files/utmpx-idled.c b/sysutils/doinkd/files/utmpx-idled.c
new file mode 100644
index 000000000000..8606b3c461e2
--- /dev/null
+++ b/sysutils/doinkd/files/utmpx-idled.c
@@ -0,0 +1,33 @@
+--- idled.c.orig 2010-01-25 16:06:48.000000000 -0800
++++ idled.c 2010-01-25 16:09:39.000000000 -0800
+@@ -335,7 +335,7 @@
+ if (strcmp(utmpbuf.ut_line,XDM_DEV) == 0)
+ {
+ /* This is the console. Is there a real name attached? */
+- if (strlen(utmpbuf.ut_name) > 0)
++ if (strlen(utmpbuf.ut_user) > 0)
+ isConsole = TRUE; /* Yes, use it */
+ else
+ strcpy(console_user,""); /* No, clear the console user */
+@@ -349,10 +349,10 @@
+ #endif /* SYSV */
+ {
+ user = &users[utmptr];
+- (void) strncpy (tmpname, utmpbuf.ut_name, NAMELEN);
++ (void) strncpy (tmpname, utmpbuf.ut_user, NAMELEN);
+ tmpname[NAMELEN] = 0;
+
+- if (!strcmp (user->uid, tmpname) && user->time_on == utmpbuf.ut_xtime)
++ if (!strcmp (user->uid, tmpname) && user->time_on == utmpbuf.ut_tv.tv_sec)
+ {
+ if (new)
+ setlimits (utmptr);
+@@ -402,7 +402,7 @@
+ logfile ("Error: could not get info on supposed user %s.",user->uid);
+ else
+ getgroups_func (pswd->pw_name, user->groups, pswd->pw_gid);
+- user->time_on = utmpbuf.ut_xtime;
++ user->time_on = utmpbuf.ut_tv.tv_sec;
+ setlimits (utmptr);
+ user->next = tempus;
+ chk_session_refuse(user);