svn commit: r201948 - user/ed/utmpx/usr.sbin/ppp
Ed Schouten
ed at FreeBSD.org
Sat Jan 9 23:13:06 UTC 2010
Author: ed
Date: Sat Jan 9 23:13:05 2010
New Revision: 201948
URL: http://svn.freebsd.org/changeset/base/201948
Log:
Use hexadecimal strings for the process identifier.
This makes it more likely for the number to fit in there, even if the
implementation only reserves four bytes for ut_id.
Modified:
user/ed/utmpx/usr.sbin/ppp/physical.c
Modified: user/ed/utmpx/usr.sbin/ppp/physical.c
==============================================================================
--- user/ed/utmpx/usr.sbin/ppp/physical.c Sat Jan 9 23:07:10 2010 (r201947)
+++ user/ed/utmpx/usr.sbin/ppp/physical.c Sat Jan 9 23:13:05 2010 (r201948)
@@ -347,7 +347,7 @@ physical_Close(struct physical *p)
memset(&ut, 0, sizeof ut);
ut.ut_type = DEAD_PROCESS;
gettimeofday(&ut.ut_tv, NULL);
- snprintf(ut.ut_id, sizeof ut.ut_id, "%dppp", (int)getpid());
+ snprintf(ut.ut_id, sizeof ut.ut_id, "%xppp", (int)getpid());
ID0logout(&ut);
p->Utmp = 0;
}
@@ -917,7 +917,7 @@ physical_Login(struct physical *p, const
memset(&ut, 0, sizeof ut);
ut.ut_type = USER_PROCESS;
gettimeofday(&ut.ut_tv, NULL);
- snprintf(ut.ut_id, sizeof ut.ut_id, "%dppp", (int)getpid());
+ snprintf(ut.ut_id, sizeof ut.ut_id, "%xppp", (int)getpid());
strncpy(ut.ut_user, name, sizeof ut.ut_user);
if (p->handler && (p->handler->type == TCP_DEVICE ||
p->handler->type == UDP_DEVICE)) {
More information about the svn-src-user
mailing list