Changeset 3910 in MondoRescue for branches/3.3/mindi-busybox/util-linux


Ignore:
Timestamp:
May 8, 2025, 5:24:25 PM (6 weeks ago)
Author:
Bruno Cornec
Message:

Remove stime usage

based on commit d3539be8f27b8cbfdfee460fe08299158f08bcd9 Mon Sep 17 00:00:00 2001
From: Alistair Francis <alistair.francis@…>

stime() has been deprecated in glibc 2.31 and replaced with
clock_settime(). Let's replace the stime() function calls with
clock_settime() in preperation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi-busybox/util-linux/rdate.c

    r3621 r3910  
    6868        if (current_time == remote_time)
    6969            bb_error_msg("current time matches remote time");
    70         else
    71             if (stime(&remote_time) < 0)
     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)
    7275                bb_perror_msg_and_die("can't set time of day");
     76        }
    7377    }
    7478
Note: See TracChangeset for help on using the changeset viewer.