According to the time(2) manual page, the argument passed to time()
system call is obsolescent and should always be NULL in new code.
When this argument is NULL, the call cannot fail.
Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
{
time_t timer;
- __time(&timer);
+ timer = __time(NULL);
timer -= SEC_PER_DAY * d_off;
localtime_r(&timer, rectime);
{
time_t timer;
- __time(&timer);
+ timer = __time(NULL);
timer -= SEC_PER_DAY * d_off;
gmtime_r(&timer, rectime);
* Test mode: Instead of reading system time, use time given on the command
* line.
*
- * OUT:
- * @t Number of seconds since the epoch, as given on the command line.
+ * RETURNS:
+ * Number of seconds since the epoch, as given on the command line.
***************************************************************************
*/
-void get_unix_time(time_t *t)
+time_t get_unix_time(time_t *t)
{
- *t = __unix_time;
+ return __unix_time;
}
/*
(char *, char *);
void get_uname
(struct utsname *);
-void get_unix_time
+time_t get_unix_time
(time_t *);
struct passwd *get_usrname
(uid_t);
time_t timer;
struct tm *ltm;
- time(&timer);
+ timer = time(NULL);
timer -= SEC_PER_DAY * d_off;
ltm = localtime(&timer);
time_t timer;
struct tm *ltm;
- time(&timer);
+ timer = time(NULL);
timer -= SEC_PER_DAY * d_off;
ltm = gmtime(&timer);