screen patch for NetBSD/sparc64

Ben Collver <[email protected]>
Newsgroups gmane.comp.gnu.screen
Message-ID <[email protected]>
Good Day,

NetBSD's time_t is typedef int, and NetBSD/sparc64's int is 32bits.
NetBSD's ut_xtime is long, and NetBSD/sparc64's long is 64bits.
With screen 4.0.1 on NetBSD/sparc64, the screen-created utmpx entries 
show absurd loging and idle times with the "w" command.  The following
patch fixes this issue, and also works on other platforms.

--- utmp.c.orig Tue Jan  8 10:44:37 2002
+++ utmp.c      Sun Sep 15 02:36:15 2002
@@ -604,6 +616,7 @@
 char *line, *user;
 int pid;
 {
+  time_t temp;
   u->ut_type = USER_PROCESS;
   strncpy(u->ut_user, user, sizeof(u->ut_user));
   /* Now the tricky part... guess ut_id */
@@ -618,7 +631,8 @@
 #endif /* sgi */
   strncpy(u->ut_line, line, sizeof(u->ut_line));
   u->ut_pid = pid;
-  (void)time((time_t *)&u->ut_time);
+  (void)time(&temp);
+  u->ut_time = temp;
 }
 
 static slot_t


Cheers,

Ben
-- 
NetBSD: It's everywhere you want to be.

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/NhFolB/TM
---------------------------------------------------------------------~->

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.