From: Karel Zak Date: Thu, 14 Jun 2007 12:43:41 +0000 (+0200) Subject: mcookie: remove non-linux code X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=039837878d63425bcaaf0c9d999c49ed843b253b;p=util-linux mcookie: remove non-linux code Something like #ifdef __linux__ is non-sense in util-linux where everything depend on linux. Signed-off-by: Karel Zak --- diff --git a/misc-utils/mcookie.c b/misc-utils/mcookie.c index dee26c56..4f141740 100644 --- a/misc-utils/mcookie.c +++ b/misc-utils/mcookie.c @@ -20,18 +20,12 @@ * */ -#ifdef __linux__ -#define HAVE_GETTIMEOFDAY 1 -#endif - #include #include #include #include "md5.h" -#ifdef HAVE_GETTIMEOFDAY #include #include -#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();