Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions criu/autofs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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;
}

Expand Down
8 changes: 4 additions & 4 deletions criu/timens.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
5 changes: 3 additions & 2 deletions criu/timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Loading