A typo bug in Samba 2.0.4 source code (here's the fix!)

Panu Outinen Panu.Outinen at vertex.fi
Tue May 18 10:14:23 GMT 1999


There's a little source code (typo?) bug in "samba-2.0.4/source/lib/system.c"
that hurts compilation at least on HPUX 9.0x (with HP's cc, not gcc!) !!

In HPUX's "/usr/include/sys/time.h":
..
# ifndef _STRUCT_TIMEVAL
#  define _STRUCT_TIMEVAL
   /* Structure returned by gettimeofday(2) system call and others */
     struct timeval {
          unsigned long tv_sec;         /* seconds */
          long          tv_usec;        /* and microseconds */
     };
# endif /* _STRUCT_TIMEVAL */
..


Here's the fix:

diff -u system.c.org system.c
--- system.c.org        Tue May 18 12:49:52 1999
+++ system.c    Tue May 18 12:50:20 1999
@@ -166,8 +166,8 @@
   /*
    * Fake it with select...
    */
-  tval.tv_secs = 0;
-  tval_tv_usecs = usecs/1000;
+  tval.tv_sec = 0;
+  tval.tv_usec = usecs/1000;
   select(0,NULL,NULL,NULL,&tval);
   return 0;
 #endif /* HAVE_USLEEP */


In HPUX 10.20's compilation there are lots of warnings:
cpp: "values.h", line 27: warning 2001: Redefinition of macro MAXINT
but these are just warnings. Nothing to be worried about (I know someone
will worry!)


------
Panu Outinen                           Tel. +358 3 313 411
Vertex Systems Oy                      Fax  +358 3 313 41450
Vaajakatu 9                            http://www.vertex.fi
33720 Tampere, FINLAND                 email: Panu.Outinen at vertex.fi



More information about the samba mailing list