Changeset 3787 in MondoRescue for tags/3.2.2/mindi-busybox/coreutils/date.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/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        }
Note: See TracChangeset for help on using the changeset viewer.