fix compiler warning in 2.4.5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




cc -O2 -pipe -Wall -g -DHAVE_PATHS_H -DIPX_CHANGE -DHAVE_MMAP -I../include '-DDESTDIR="/usr/local"' -DCHAPMS=1 -DMPPE=1 -DHAS_SHADOW -DHAVE
_CRYPT_H=1 -DUSE_CRYPT=1 -DHAVE_MULTILINK -DUSE_TDB=1 -DPLUGIN -DMAXOCTETS   -c -o sys-linux.o sys-linux.c
sys-linux.c: In function ‘logwtmp’:
sys-linux.c:2185: warning: passing argument 1 of ‘time’ from incompatible pointer type

on 64bit time_t is 64bit

re,
 wh



--- sys-linux.c.org     2010-03-11 17:58:44.000000000 +0100
+++ sys-linux.c 2010-03-11 18:04:37.000000000 +0100
@@ -2160,7 +2160,7 @@
 #if __GLIBC__ < 2
     int    wtmp;
 #endif
-
+       time_t zeit;
 /*
  * Update the signon database for users.
  * Christoph Lameter: Copied from poeigl-1.36 Jan 3, 1996
@@ -2182,7 +2182,21 @@
     strncpy(ut.ut_user, name, sizeof(ut.ut_user));
     strncpy(ut.ut_line, line, sizeof(ut.ut_line));

-    time(&ut.ut_time);
+/*
+       ut_time is not what is seems to be:
+       # define ut_time        ut_tv.tv_sec
+
+       struct
+       {
+       int32_t tv_sec;             // Seconds.
+       int32_t tv_usec;            // Microseconds.
+       } ut_tv;                    // Time entry was made.
+
+       this will silence the compiler until 2036 when then earth stops
+*/
+
+    time(&zeit);
+    ut.ut_time=(int32_t)zeit;

     ut.ut_type = USER_PROCESS;
     ut.ut_pid  = mypid;


--
To unsubscribe from this list: send the line "unsubscribe linux-ppp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Audio Users]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux