]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
mcookie: remove non-linux code
authorKarel Zak <kzak@redhat.com>
Thu, 14 Jun 2007 12:43:41 +0000 (14:43 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 14 Jun 2007 12:43:41 +0000 (14:43 +0200)
Something like #ifdef __linux__ is non-sense in util-linux where
everything depend on linux.

Signed-off-by: Karel Zak <kzak@redhat.com>
misc-utils/mcookie.c

index dee26c5603e703de4e76a0cb6a1e5d44a6e64004..4f14174025cd0f8ef4925ec48fc493237a53d875 100644 (file)
  *
  */
 
-#ifdef __linux__
-#define HAVE_GETTIMEOFDAY 1
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <fcntl.h>
 #include "md5.h"
-#ifdef HAVE_GETTIMEOFDAY
 #include <sys/time.h>
 #include <unistd.h>
-#endif
 #include "nls.h"
 
 #define BUFFERSIZE 4096
@@ -79,12 +73,8 @@ int main( int argc, char **argv )
    pid_t             pid;
    char              *file = NULL;
    int               r;
-#ifdef HAVE_GETTIMEOFDAY
    struct timeval    tv;
    struct timezone   tz;
-#else
-   long int          t;
-#endif
 
    setlocale(LC_ALL, "");
    bindtextdomain(PACKAGE, LOCALEDIR);
@@ -97,14 +87,9 @@ int main( int argc, char **argv )
       }
 
    MD5Init( &ctx );
-   
-#ifdef HAVE_GETTIMEOFDAY
    gettimeofday( &tv, &tz );
    MD5Update( &ctx, (unsigned char *)&tv, sizeof( tv ) );
-#else
-   time( &t );
-   MD5Update( &ctx, (unsigned char *)&t, sizeof( t ) );
-#endif
+
    pid = getppid();
    MD5Update( &ctx, (unsigned char *)&pid, sizeof( pid ));
    pid = getpid();