Changeset 3787 in MondoRescue for tags/3.2.2/mindi-busybox/util-linux/rdate.c


Ignore:
Timestamp:
Aug 13, 2022, 12:10:38 AM (22 months ago)
Author:
Bruno Cornec
Message:

Fix the stime function not available with glibc 2.31+

Apply fix coming from https://git.busybox.net/busybox/patch/?id=d3539be8f27b8cbfdfee460fe08299158f08bcd9

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tags/3.2.2/mindi-busybox/util-linux/rdate.c

    r3232 r3787  
    6868        if (current_time == remote_time)
    6969            bb_error_msg("current time matches remote time");
    70         else
    71             if (stime(&remote_time) < 0)
    72                 bb_perror_msg_and_die("can't set time of day");
     70        else {
     71            struct timespec ts;
     72            ts.tv_sec = remote_time;
     73            ts.tv_nsec = 0;
     74            if (clock_settime(CLOCK_REALTIME, &ts) < 0)
     75                bb_simple_perror_msg_and_die("can't set time of day");
    7376    }
    7477
Note: See TracChangeset for help on using the changeset viewer.