2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

criu: use proper format-specified to accommodate time_t 64-bit change

See also:
https://wiki.debian.org/ReleaseGoals/64bit-time

Signed-off-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
This commit is contained in:
Alexander Mikhalitsyn
2024-05-26 14:44:14 +02:00
committed by Andrei Vagin
parent 95f66d13db
commit 457bc6a8ff
3 changed files with 9 additions and 8 deletions

View File

@@ -658,7 +658,7 @@ static int autofs_mnt_make_catatonic(const char *mnt_path, int mnt_fd)
static int autofs_mnt_set_timeout(time_t timeout, const char *mnt_path, int mnt_fd)
{
pr_info("%s: set timeout %ld for %s\n", __func__, timeout, mnt_path);
pr_info("%s: set timeout %" PRId64 " for %s\n", __func__, (int64_t)timeout, mnt_path);
return autofs_ioctl(mnt_path, mnt_fd, AUTOFS_IOC_SETTIMEOUT, &timeout);
}
@@ -770,7 +770,7 @@ static int autofs_post_mount(const char *mnt_path, dev_t mnt_dev, time_t timeout
}
if (autofs_mnt_set_timeout(timeout, mnt_path, mnt_fd)) {
pr_err("Failed to set timeout %ld for %s\n", timeout, mnt_path);
pr_err("Failed to set timeout %" PRId64 " for %s\n", (int64_t)timeout, mnt_path);
return -1;
}

View File

@@ -96,8 +96,8 @@ int prepare_timens(int id)
ts.tv_nsec = te->monotonic->tv_nsec - ts.tv_nsec;
normalize_timespec(&ts);
pr_debug("timens: monotonic %ld %ld\n", ts.tv_sec, ts.tv_nsec);
if (dprintf(fd, "%d %ld %ld\n", CLOCK_MONOTONIC, ts.tv_sec, ts.tv_nsec) < 0) {
pr_debug("timens: monotonic %" PRId64 " %ld\n", (int64_t)ts.tv_sec, ts.tv_nsec);
if (dprintf(fd, "%d %" PRId64 " %ld\n", CLOCK_MONOTONIC, (int64_t)ts.tv_sec, ts.tv_nsec) < 0) {
pr_perror("Unable to set a monotonic clock offset");
goto err;
}
@@ -111,8 +111,8 @@ int prepare_timens(int id)
ts.tv_nsec = te->boottime->tv_nsec - ts.tv_nsec;
normalize_timespec(&ts);
pr_debug("timens: boottime %ld %ld\n", ts.tv_sec, ts.tv_nsec);
if (dprintf(fd, "%d %ld %ld\n", CLOCK_BOOTTIME, ts.tv_sec, ts.tv_nsec) < 0) {
pr_debug("timens: boottime %" PRId64 " %ld\n", (int64_t)ts.tv_sec, ts.tv_nsec);
if (dprintf(fd, "%d %" PRId64 " %ld\n", CLOCK_BOOTTIME, (int64_t)ts.tv_sec, ts.tv_nsec) < 0) {
pr_perror("Unable to set a boottime clock offset");
goto err;
}

View File

@@ -46,8 +46,9 @@ static inline int decode_itimer(char *n, ItimerEntry *ie, struct itimerval *val)
return -1;
}
pr_info("Restored %s timer to %ld.%ld -> %ld.%ld\n", n, val->it_value.tv_sec, val->it_value.tv_usec,
val->it_interval.tv_sec, val->it_interval.tv_usec);
pr_info("Restored %s timer to %" PRId64 ".%ld -> %" PRId64 ".%ld\n", n,
(int64_t)val->it_value.tv_sec, val->it_value.tv_usec,
(int64_t)val->it_interval.tv_sec, val->it_interval.tv_usec);
return 0;
}