From d8dca37d6560a96261beab99d16388e1d8dc2412 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 10 Mar 2016 21:04:48 +0100 Subject: [PATCH] Replaced unused timezone parameter of gettimeofday() by NULL --- libisofs/libiso_msgs.c | 5 ++--- libisofs/make_isohybrid_mbr.c | 6 ++---- libisofs/system_area.c | 3 +-- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/libisofs/libiso_msgs.c b/libisofs/libiso_msgs.c index 81ddcef..90d4bbd 100644 --- a/libisofs/libiso_msgs.c +++ b/libisofs/libiso_msgs.c @@ -1,7 +1,7 @@ /* libiso_msgs (generated from libdax_msgs : Fri Feb 22 19:42:52 CET 2008) Message handling facility of libisofs. - Copyright (C) 2006 - 2008 Thomas Schmitt , + Copyright (C) 2006 - 2016 Thomas Schmitt , provided under GPL version 2 or later */ @@ -33,14 +33,13 @@ static int libiso_msgs_item_new(struct libiso_msgs_item **item, int ret; struct libiso_msgs_item *o; struct timeval tv; - struct timezone tz; (*item)= o= (struct libiso_msgs_item *) malloc(sizeof(struct libiso_msgs_item)); if(o==NULL) return(-1); o->timestamp= 0.0; - ret= gettimeofday(&tv,&tz); + ret= gettimeofday(&tv, NULL); if(ret==0) o->timestamp= tv.tv_sec+0.000001*tv.tv_usec; o->process_id= getpid(); diff --git a/libisofs/make_isohybrid_mbr.c b/libisofs/make_isohybrid_mbr.c index b4a3e7b..61aedc9 100644 --- a/libisofs/make_isohybrid_mbr.c +++ b/libisofs/make_isohybrid_mbr.c @@ -158,7 +158,6 @@ int make_isohybrid_mbr(int bin_lba, int *img_blocks, char *mbr, int flag) /* For generating a weak random number */ struct timeval tv; - struct timezone tz; if (bin_lba < 0 || bin_lba >= (1 << 29)) return (0); /* 1 TB limit of signed 32 bit addressing of 512 byte blocks */ @@ -213,7 +212,7 @@ int make_isohybrid_mbr(int bin_lba, int *img_blocks, char *mbr, int flag) from. An environment variable ? 125: Whatever, i use some 32-bit random value with no crypto strength. */ - gettimeofday(&tv, &tz); + gettimeofday(&tv, NULL); id = 0xffffffff & (tv.tv_sec ^ (tv.tv_usec * 2000)); /* @@ -621,7 +620,6 @@ int make_isolinux_mbr(uint32_t *img_blocks, Ecma119Image *t, int gpt_count = 0, gpt_idx[128], apm_count = 0, gpt_cursor, i; /* For generating a weak random number */ struct timeval tv; - struct timezone tz; if (t->bootsrc[0] == NULL) return iso_msg_submit(t->image->id, ISO_BOOT_IMAGE_NOT_VALID, 0, @@ -670,7 +668,7 @@ int make_isolinux_mbr(uint32_t *img_blocks, Ecma119Image *t, (here some 32-bit random value with no crypto strength) */ if (flag & 1) { - gettimeofday(&tv, &tz); + gettimeofday(&tv, NULL); id = 0xffffffff & (tv.tv_sec ^ (tv.tv_usec * 2000)); lsb_to_buf(&wpt, id, 32, 0); } else { diff --git a/libisofs/system_area.c b/libisofs/system_area.c index 59b6081..5394a1d 100644 --- a/libisofs/system_area.c +++ b/libisofs/system_area.c @@ -2354,7 +2354,6 @@ void iso_random_uuid(Ecma119Image *t, uint8_t uuid[16]) static uint8_t uuid_urandom[16]; uint32_t rnd, salt; struct timeval tv; - struct timezone tz; pid_t pid; static int counter = 0, use_urandom = 0; int i, ret, fd; @@ -2404,7 +2403,7 @@ fallback:; per day. */ memcpy(u, uuid_template, 16); - gettimeofday(&tv, &tz); + gettimeofday(&tv, NULL); for (i = 0; i < 4; i++) u[i] = (salt >> (8 * i)) & 0xff; for (i = 0; i < 2; i++)