Changeset 3787 in MondoRescue for tags


Ignore:
Timestamp:
Aug 13, 2022, 12:10:38 AM (21 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

Location:
tags/3.2.2/mindi-busybox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tags/3.2.2/mindi-busybox/coreutils/date.c

    r3232 r3787  
    268268#endif
    269269    }
     270#if !ENABLE_FEATURE_DATE_NANO
     271    ts.tv_nsec = 0;
     272#endif
    270273    localtime_r(&ts.tv_sec, &tm_time);
    271274
     
    290293            tm_time.tm_isdst = -1;
    291294        ts.tv_sec = validate_tm_time(date_str, &tm_time);
     295        ts.tv_nsec = 0;
    292296
    293297        maybe_set_utc(opt);
    294298
    295299        /* if setting time, set it */
    296         if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) {
     300        if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) {
    297301            bb_perror_msg("can't set date");
    298302        }
  • 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.