Replaced unused timezone parameter of gettimeofday() by NULL

This commit is contained in:
Thomas Schmitt 2016-03-10 19:56:14 +00:00
parent 8b458422e6
commit af5e1a14e8
4 changed files with 11 additions and 15 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2016.03.08.073402" #define Cdrskin_timestamP "2016.03.10.195636"

View File

@ -1,7 +1,7 @@
/* libdax_msgs /* libdax_msgs
Message handling facility of libdax. Message handling facility of libdax.
Copyright (C) 2006 - 2010 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.
*/ */
@ -34,14 +34,13 @@ static int libdax_msgs_item_new(struct libdax_msgs_item **item,
int ret; int ret;
struct libdax_msgs_item *o; struct libdax_msgs_item *o;
struct timeval tv; struct timeval tv;
struct timezone tz;
(*item)= o= (*item)= o=
(struct libdax_msgs_item *) calloc(1, sizeof(struct libdax_msgs_item)); (struct libdax_msgs_item *) calloc(1, sizeof(struct libdax_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

@ -1,7 +1,7 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2015 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.
*/ */
@ -744,7 +744,6 @@ static int mmc_wait_for_buffer_free(struct burn_drive *d, struct buffer *buf)
{ {
int usec= 0, need, reported_3s = 0, first_wait = 1; int usec= 0, need, reported_3s = 0, first_wait = 1;
struct timeval t0,tnow; struct timeval t0,tnow;
struct timezone dummy_tz;
double max_fac, min_fac, waiting; double max_fac, min_fac, waiting;
/* Enable to get reported waiting activities and total time. /* Enable to get reported waiting activities and total time.
@ -781,7 +780,7 @@ static int mmc_wait_for_buffer_free(struct burn_drive *d, struct buffer *buf)
/* There is need to inquire the buffer fill */ /* There is need to inquire the buffer fill */
d->pessimistic_writes++; d->pessimistic_writes++;
min_fac = ((double) d->wfb_min_percent) / 100.0; min_fac = ((double) d->wfb_min_percent) / 100.0;
gettimeofday(&t0, &dummy_tz); gettimeofday(&t0, NULL);
#ifdef Libburn_mmc_wfb_debuG #ifdef Libburn_mmc_wfb_debuG
sleeplist[0]= 0; sleeplist[0]= 0;
sprintf(sleeplist,"(%d%s %d)", sprintf(sleeplist,"(%d%s %d)",
@ -802,7 +801,7 @@ static int mmc_wait_for_buffer_free(struct burn_drive *d, struct buffer *buf)
(d->pbf_altered ? "? -" : " -"), (d->pbf_altered ? "? -" : " -"),
(int) ((1.0 - min_fac) * d->progress.buffer_capacity)); (int) ((1.0 - min_fac) * d->progress.buffer_capacity));
#endif #endif
gettimeofday(&tnow,&dummy_tz); gettimeofday(&tnow, NULL);
waiting = (tnow.tv_sec - t0.tv_sec) + waiting = (tnow.tv_sec - t0.tv_sec) +
((double) (tnow.tv_usec - t0.tv_usec)) / 1.0e6; ((double) (tnow.tv_usec - t0.tv_usec)) / 1.0e6;
if (d->pessimistic_buffer_free - buf->bytes >= if (d->pessimistic_buffer_free - buf->bytes >=
@ -905,10 +904,9 @@ static int print_time(int flag)
{ {
static struct timeval prev = {0, 0}; static struct timeval prev = {0, 0};
struct timeval now; struct timeval now;
struct timezone tz;
int ret, diff; int ret, diff;
ret = gettimeofday(&now, &tz); ret = gettimeofday(&now, NULL);
if (ret == -1) if (ret == -1)
return 0; return 0;
if (now.tv_sec - prev.tv_sec < Libburn_scsi_write_timeouT) { if (now.tv_sec - prev.tv_sec < Libburn_scsi_write_timeouT) {

View File

@ -1,7 +1,7 @@
/* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */ /* -*- indent-tabs-mode: t; tab-width: 8; c-basic-offset: 8; -*- */
/* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens /* Copyright (c) 2004 - 2006 Derek Foreman, Ben Jansens
Copyright (c) 2006 - 2012 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.
*/ */
@ -2748,16 +2748,15 @@ int burn_stdio_slowdown(struct burn_drive *d, struct timeval *prev_time,
int amount, int flag) int amount, int flag)
{ {
struct timeval tnow; struct timeval tnow;
struct timezone dummy_tz;
double to_wait; double to_wait;
if (flag & 1) { if (flag & 1) {
gettimeofday(prev_time, &dummy_tz); gettimeofday(prev_time, NULL);
return 1; return 1;
} }
if(d->nominal_write_speed <= 0) if(d->nominal_write_speed <= 0)
return 2; return 2;
gettimeofday(&tnow, &dummy_tz); gettimeofday(&tnow, NULL);
to_wait = ( ((double) amount) / (double) d->nominal_write_speed ) - to_wait = ( ((double) amount) / (double) d->nominal_write_speed ) -
(double) ( tnow.tv_sec - prev_time->tv_sec ) - (double) ( tnow.tv_sec - prev_time->tv_sec ) -
(double) ( tnow.tv_usec - prev_time->tv_usec ) / 1.0e6 (double) ( tnow.tv_usec - prev_time->tv_usec ) / 1.0e6
@ -2765,7 +2764,7 @@ int burn_stdio_slowdown(struct burn_drive *d, struct timeval *prev_time,
if (to_wait >= 0.0001) { if (to_wait >= 0.0001) {
usleep((int) (to_wait * 1000000.0)); usleep((int) (to_wait * 1000000.0));
} }
gettimeofday(prev_time, &dummy_tz); gettimeofday(prev_time, NULL);
return 1; return 1;
} }