source: ProjectBuilder/projects/mondorescue/pbconf/branches/3.3/mindi-busybox/pbpatch/02-stime.fedora-33@ 2660

Last change on this file since 2660 was 2660, checked in by Bruno Cornec, 3 years ago

Fixes to allow compilation on Fedora 33

File size: 1.9 KB
Line 
1diff -ru mindi-busybox-1.25.1.0.20201125195427.orig/coreutils/date.c mindi-busybox-1.25.1.0.20201125195427/coreutils/date.c
2--- mindi-busybox-1.25.1.0.20201125195427.orig/coreutils/date.c 2020-06-17 02:26:14.000000000 +0200
3+++ mindi-busybox-1.25.1.0.20201125195427/coreutils/date.c 2020-11-26 00:18:27.978053015 +0100
4@@ -298,7 +298,7 @@
5 maybe_set_utc(opt);
6
7 /* if setting time, set it */
8- if ((opt & OPT_SET) && stime(&ts.tv_sec) < 0) {
9+ if ((opt & OPT_SET) && clock_settime(CLOCK_REALTIME, &ts) < 0) {
10 bb_perror_msg("can't set date");
11 }
12 }
13diff -ru mindi-busybox-1.25.1.0.20201125195427.orig/libbb/missing_syscalls.c mindi-busybox-1.25.1.0.20201125195427/libbb/missing_syscalls.c
14--- mindi-busybox-1.25.1.0.20201125195427.orig/libbb/missing_syscalls.c 2016-12-20 16:07:32.000000000 +0100
15+++ mindi-busybox-1.25.1.0.20201125195427/libbb/missing_syscalls.c 2020-11-26 00:18:52.037748613 +0100
16@@ -16,14 +16,6 @@
17 return syscall(__NR_getsid, pid);
18 }
19
20-int stime(const time_t *t)
21-{
22- struct timeval tv;
23- tv.tv_sec = *t;
24- tv.tv_usec = 0;
25- return settimeofday(&tv, NULL);
26-}
27-
28 int sethostname(const char *name, size_t len)
29 {
30 return syscall(__NR_sethostname, name, len);
31diff -ru mindi-busybox-1.25.1.0.20201125195427.orig/util-linux/rdate.c mindi-busybox-1.25.1.0.20201125195427/util-linux/rdate.c
32--- mindi-busybox-1.25.1.0.20201125195427.orig/util-linux/rdate.c 2016-12-20 16:07:32.000000000 +0100
33+++ mindi-busybox-1.25.1.0.20201125195427/util-linux/rdate.c 2020-11-26 00:20:51.406239211 +0100
34@@ -67,9 +67,13 @@
35 time(&current_time);
36 if (current_time == remote_time)
37 bb_error_msg("current time matches remote time");
38- else
39- if (stime(&remote_time) < 0)
40+ else {
41+ struct timespec ts;
42+ ts.tv_sec = remote_time;
43+ ts.tv_nsec = 0;
44+ if (clock_settime(CLOCK_REALTIME, &ts) < 0)
45 bb_perror_msg_and_die("can't set time of day");
46+ }
47 }
48
49 if (flags != 1) /* not lone -s */
Note: See TracBrowser for help on using the repository browser.