If mktime() or timegm() return -1, print out the resume timer value as
"unknown", rather than a conversion of -1 to a date/timestamp.
This commit is contained in:
parent
45cabbdc58
commit
bc8aff4484
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117517
@ -293,9 +293,12 @@ print_all_info(int fd, apm_info_t aip, int bioscall_available)
|
||||
t = mktime(&tm);
|
||||
else
|
||||
t = timegm(&tm);
|
||||
if (t != -1) {
|
||||
tm = *localtime(&t);
|
||||
strftime(buf, sizeof(buf), "%c", &tm);
|
||||
printf("Resume timer: %s\n", buf);
|
||||
} else
|
||||
printf("Resume timer: unknown\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user