Date: Sat, 9 Jan 2010 23:13:05 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r201948 - user/ed/utmpx/usr.sbin/ppp Message-ID: <201001092313.o09ND56F044188@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001092313.o09ND56F044188>