Replaced unused timezone parameter of gettimeofday() by NULL

This commit is contained in:
Thomas Schmitt 2016-03-10 21:04:48 +01:00
parent cd84f0927f
commit d8dca37d65
3 changed files with 5 additions and 9 deletions

View File

@ -1,7 +1,7 @@
/* libiso_msgs (generated from libdax_msgs : Fri Feb 22 19:42:52 CET 2008) /* libiso_msgs (generated from libdax_msgs : Fri Feb 22 19:42:52 CET 2008)
Message handling facility of libisofs. Message handling facility of libisofs.
Copyright (C) 2006 - 2008 Thomas Schmitt <scdbackup@gmx.net>, Copyright (C) 2006 - 2016 Thomas Schmitt <scdbackup@gmx.net>,
provided under GPL version 2 or later provided under GPL version 2 or later
*/ */
@ -33,14 +33,13 @@ static int libiso_msgs_item_new(struct libiso_msgs_item **item,
int ret; int ret;
struct libiso_msgs_item *o; struct libiso_msgs_item *o;
struct timeval tv; struct timeval tv;
struct timezone tz;
(*item)= o= (*item)= o=
(struct libiso_msgs_item *) malloc(sizeof(struct libiso_msgs_item)); (struct libiso_msgs_item *) malloc(sizeof(struct libiso_msgs_item));
if(o==NULL) if(o==NULL)
return(-1); return(-1);
o->timestamp= 0.0; o->timestamp= 0.0;
ret= gettimeofday(&tv,&tz); ret= gettimeofday(&tv, NULL);
if(ret==0) if(ret==0)
o->timestamp= tv.tv_sec+0.000001*tv.tv_usec; o->timestamp= tv.tv_sec+0.000001*tv.tv_usec;
o->process_id= getpid(); o->process_id= getpid();

View File

@ -158,7 +158,6 @@ int make_isohybrid_mbr(int bin_lba, int *img_blocks, char *mbr, int flag)
/* For generating a weak random number */ /* For generating a weak random number */
struct timeval tv; struct timeval tv;
struct timezone tz;
if (bin_lba < 0 || bin_lba >= (1 << 29)) if (bin_lba < 0 || bin_lba >= (1 << 29))
return (0); /* 1 TB limit of signed 32 bit addressing of 512 byte blocks */ 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 ? from. An environment variable ?
125: Whatever, i use some 32-bit random value with no crypto strength. 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)); 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; int gpt_count = 0, gpt_idx[128], apm_count = 0, gpt_cursor, i;
/* For generating a weak random number */ /* For generating a weak random number */
struct timeval tv; struct timeval tv;
struct timezone tz;
if (t->bootsrc[0] == NULL) if (t->bootsrc[0] == NULL)
return iso_msg_submit(t->image->id, ISO_BOOT_IMAGE_NOT_VALID, 0, 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) (here some 32-bit random value with no crypto strength)
*/ */
if (flag & 1) { if (flag & 1) {
gettimeofday(&tv, &tz); gettimeofday(&tv, NULL);
id = 0xffffffff & (tv.tv_sec ^ (tv.tv_usec * 2000)); id = 0xffffffff & (tv.tv_sec ^ (tv.tv_usec * 2000));
lsb_to_buf(&wpt, id, 32, 0); lsb_to_buf(&wpt, id, 32, 0);
} else { } else {

View File

@ -2354,7 +2354,6 @@ void iso_random_uuid(Ecma119Image *t, uint8_t uuid[16])
static uint8_t uuid_urandom[16]; static uint8_t uuid_urandom[16];
uint32_t rnd, salt; uint32_t rnd, salt;
struct timeval tv; struct timeval tv;
struct timezone tz;
pid_t pid; pid_t pid;
static int counter = 0, use_urandom = 0; static int counter = 0, use_urandom = 0;
int i, ret, fd; int i, ret, fd;
@ -2404,7 +2403,7 @@ fallback:;
per day. per day.
*/ */
memcpy(u, uuid_template, 16); memcpy(u, uuid_template, 16);
gettimeofday(&tv, &tz); gettimeofday(&tv, NULL);
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
u[i] = (salt >> (8 * i)) & 0xff; u[i] = (salt >> (8 * i)) & 0xff;
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)