[CRIU] [PATCH] test: add printf-attribute to test_msg
Dmitry Safonov
dsafonov at virtuozzo.com
Tue Jul 12 09:17:28 PDT 2016
...and fix misprints that weren't caught before.
I guess, I never fixed that much (possible) bugs by one commit, heh.
Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
---
test/zdtm/lib/test.c | 2 +-
test/zdtm/lib/zdtmtst.h | 3 ++-
test/zdtm/static/autofs.c | 22 +++++++++++-----------
test/zdtm/static/cgroup_stray.c | 2 +-
test/zdtm/static/deleted_dev.c | 4 ++--
test/zdtm/static/deleted_unix_sock.c | 2 +-
test/zdtm/static/fdt_shared.c | 2 +-
test/zdtm/static/file_attr.c | 2 +-
test/zdtm/static/inotify_system.c | 4 ++--
test/zdtm/static/inotify_system_nodel.c | 3 +--
test/zdtm/static/ipc_namespace.c | 8 ++++----
test/zdtm/static/link10.c | 5 +++--
test/zdtm/static/maps02.c | 4 ++--
test/zdtm/static/mlock_setuid.c | 3 ++-
test/zdtm/static/mntns_link_remap.c | 2 +-
test/zdtm/static/mtime_mmap.c | 5 ++---
test/zdtm/static/overmount_dev.c | 2 +-
test/zdtm/static/overmount_fifo.c | 2 +-
test/zdtm/static/sem.c | 2 +-
test/zdtm/static/session00.c | 2 +-
test/zdtm/static/session02.c | 2 +-
test/zdtm/static/session03.c | 2 +-
test/zdtm/static/sigaltstack.c | 2 +-
test/zdtm/static/unlink_fstat00.c | 8 +++++---
test/zdtm/static/unlink_fstat01.c | 6 +++---
test/zdtm/static/unlink_fstat02.c | 6 +++---
test/zdtm/static/unlink_fstat03.c | 6 +++---
test/zdtm/static/unlink_largefile.c | 3 +--
test/zdtm/static/unlink_regular00.c | 3 ++-
test/zdtm/static/write_read10.c | 3 ++-
test/zdtm/transition/maps007.c | 5 +++--
test/zdtm/transition/pipe_loop00.c | 2 +-
test/zdtm/transition/socket_loop00.c | 2 +-
33 files changed, 68 insertions(+), 63 deletions(-)
diff --git a/test/zdtm/lib/test.c b/test/zdtm/lib/test.c
index ed7aaa6bfa9a..db7118d052a2 100644
--- a/test/zdtm/lib/test.c
+++ b/test/zdtm/lib/test.c
@@ -204,7 +204,7 @@ void test_init(int argc, char **argv)
if (futex_get(&sig_received) == SIGCHLD) {
int ret;
if (waitpid(pid, &ret, 0) != pid) {
- pr_perror("Unable to wait %d, pid");
+ pr_perror("Unable to wait %d", pid);
exit(1);
}
diff --git a/test/zdtm/lib/zdtmtst.h b/test/zdtm/lib/zdtmtst.h
index 1afad70c70a1..929db8d09c16 100644
--- a/test/zdtm/lib/zdtmtst.h
+++ b/test/zdtm/lib/zdtmtst.h
@@ -31,7 +31,8 @@ extern int test_fork_id(int id);
/* finish setting up the test, write out pid file, and go to background */
extern void test_daemon(void);
/* store a message to a static buffer */
-extern void test_msg(const char *format, ...);
+extern void test_msg(const char *format, ...)
+ __attribute__ ((__format__ (__printf__, 1, 2)));
/* tell if SIGTERM hasn't been received yet */
extern int test_go(void);
/* sleep until SIGTERM is delivered */
diff --git a/test/zdtm/static/autofs.c b/test/zdtm/static/autofs.c
index d7af791aba3c..8d75b6e68892 100644
--- a/test/zdtm/static/autofs.c
+++ b/test/zdtm/static/autofs.c
@@ -188,7 +188,7 @@ static int check_fd(struct autofs_params *p)
}
if (st.st_dev != p->fd_stat.st_dev) {
- skip("%s: st_dev differs: %d != %d "
+ skip("%s: st_dev differs: %lu != %lu "
"(waiting for \"device namespaces\")", p->mountpoint,
st.st_dev, p->fd_stat.st_dev);
// ret++;
@@ -199,37 +199,37 @@ static int check_fd(struct autofs_params *p)
ret++;
}
if (st.st_nlink != p->fd_stat.st_nlink) {
- pr_err("%s: st_nlink differs:\n", p->mountpoint,
+ pr_err("%s: st_nlink differs: %ld != %ld\n", p->mountpoint,
st.st_nlink, p->fd_stat.st_nlink);
ret++;
}
if (st.st_uid != p->fd_stat.st_uid) {
- pr_err("%s: st_uid differs:\n", p->mountpoint,
+ pr_err("%s: st_uid differs: %u != %u\n", p->mountpoint,
st.st_uid, p->fd_stat.st_uid);
ret++;
}
if (st.st_gid != p->fd_stat.st_gid) {
- pr_err("%s: st_gid differs:\n", p->mountpoint,
+ pr_err("%s: st_gid differs: %u != %u\n", p->mountpoint,
st.st_gid, p->fd_stat.st_gid);
ret++;
}
if (st.st_rdev != p->fd_stat.st_rdev) {
- pr_err("%s: st_rdev differs:\n", p->mountpoint,
+ pr_err("%s: st_rdev differs: %ld != %ld\n", p->mountpoint,
st.st_rdev, p->fd_stat.st_rdev);
ret++;
}
if (st.st_size != p->fd_stat.st_size) {
- pr_err("%s: st_size differs:\n", p->mountpoint,
+ pr_err("%s: st_size differs: %ld != %ld\n", p->mountpoint,
st.st_size, p->fd_stat.st_size);
ret++;
}
if (st.st_blksize != p->fd_stat.st_blksize) {
- pr_err("%s: st_blksize differs:\n", p->mountpoint,
+ pr_err("%s: st_blksize differs %ld != %ld:\n", p->mountpoint,
st.st_blksize, p->fd_stat.st_blksize);
ret++;
}
if (st.st_blocks != p->fd_stat.st_blocks) {
- pr_err("%s: st_blocks differs:\n", p->mountpoint,
+ pr_err("%s: st_blocks differs: %ld != %ld\n", p->mountpoint,
st.st_blocks, p->fd_stat.st_blocks);
ret++;
}
@@ -244,7 +244,7 @@ static int check_automount(struct autofs_params *p)
err = check_fd(p);
if (err) {
- pr_err("%d: opened file descriptor wasn't migrated properly\n",
+ pr_err("%s: opened file descriptor wasn't migrated properly\n",
p->mountpoint);
return err;
}
@@ -441,7 +441,7 @@ static int automountd_serve(const char *mountpoint, struct autofs_params *p,
getpid());
return -EINVAL;
default:
- pr_err("unknown request type: %ld\n", packet->hdr.type);
+ pr_err("unknown request type: %d\n", packet->hdr.type);
return -EINVAL;
}
@@ -608,7 +608,7 @@ static int start_automounter(struct autofs_params *p)
return -errno;
}
if (bytes != sizeof(ret)) {
- pr_err("received less than expected: %d. Child %d died?\n",
+ pr_err("received less than expected: %zu. Child %d died?\n",
bytes, p->pid);
return -EINVAL;
}
diff --git a/test/zdtm/static/cgroup_stray.c b/test/zdtm/static/cgroup_stray.c
index 204ffb73a392..9736845c07ab 100644
--- a/test/zdtm/static/cgroup_stray.c
+++ b/test/zdtm/static/cgroup_stray.c
@@ -207,7 +207,7 @@ int main(int argc, char **argv)
}
if (!WIFEXITED(status) || WEXITSTATUS(status)) {
- fail("exit status %s\n", status);
+ fail("exit status %d\n", status);
goto out_umount;
}
diff --git a/test/zdtm/static/deleted_dev.c b/test/zdtm/static/deleted_dev.c
index e855aed69298..6c95c6189ff3 100644
--- a/test/zdtm/static/deleted_dev.c
+++ b/test/zdtm/static/deleted_dev.c
@@ -50,7 +50,7 @@ int main(int argc, char **argv)
if (st.st_mode != mode || st.st_rdev != dev) {
fail("%s is no longer the device file we had", filename);
- test_msg("mode %x want %x, dev %x want %x\n",
+ test_msg("mode %x want %x, dev %lx want %lx\n",
st.st_mode, mode, st.st_rdev, dev);
goto out;
}
@@ -61,7 +61,7 @@ int main(int argc, char **argv)
}
if (unlink(filename) != -1 || errno != ENOENT) {
- fail("file %s should have been deleted before migration: unlink: %m\n");
+ fail("file %s should have been deleted before migration: unlink: %m\n", filename);
goto out;
}
diff --git a/test/zdtm/static/deleted_unix_sock.c b/test/zdtm/static/deleted_unix_sock.c
index 3562e26354ce..793c96884a3e 100644
--- a/test/zdtm/static/deleted_unix_sock.c
+++ b/test/zdtm/static/deleted_unix_sock.c
@@ -180,7 +180,7 @@ int main(int argc, char ** argv)
}
if (unlink(filename) != -1 || errno != ENOENT) {
- fail("file %s should have been deleted before migration: unlink: %m\n");
+ fail("file %s should have been deleted before migration: unlink: %m\n", filename);
goto out;
}
diff --git a/test/zdtm/static/fdt_shared.c b/test/zdtm/static/fdt_shared.c
index 908f6bcd0b09..e66f9f56de3e 100644
--- a/test/zdtm/static/fdt_shared.c
+++ b/test/zdtm/static/fdt_shared.c
@@ -175,7 +175,7 @@ int main(int argc, char ** argv)
fd = dup2(fd, TEST_FD);
if (fd == -1) {
- pr_perror("Can't dup fd to %d", fd, TEST_FD);
+ pr_perror("Can't dup fd %d to %d", fd, TEST_FD);
return -1;
}
diff --git a/test/zdtm/static/file_attr.c b/test/zdtm/static/file_attr.c
index 80ad78914451..eb1c2a202fce 100644
--- a/test/zdtm/static/file_attr.c
+++ b/test/zdtm/static/file_attr.c
@@ -108,7 +108,7 @@ int main(int argc, char ** argv)
}
if (unlink(filename) != -1 || errno != ENOENT) {
- fail("file %s should have been deleted before migration: unlink: %m\n");
+ fail("file %s should have been deleted before migration: unlink: %m\n", filename);
goto out_noclose;
}
diff --git a/test/zdtm/static/inotify_system.c b/test/zdtm/static/inotify_system.c
index 6a95f5b2ca4a..360779be5226 100644
--- a/test/zdtm/static/inotify_system.c
+++ b/test/zdtm/static/inotify_system.c
@@ -296,8 +296,8 @@ next_event:
int read_set(int inot_fd, char *event_set) {
int len;
if ((len = read(inot_fd, event_set, EVENT_BUF_LEN)) < 0) {
- pr_perror("read(%d, buf, %d) Failed, errno=%d : %s",
- inot_fd, EVENT_BUF_LEN, errno, strerror(errno));
+ pr_perror("read(%d, buf, %lu) Failed, errno=%d",
+ inot_fd, EVENT_BUF_LEN, errno);
return -1;
}
return len;
diff --git a/test/zdtm/static/inotify_system_nodel.c b/test/zdtm/static/inotify_system_nodel.c
index 6a95f5b2ca4a..af1370b66041 100644
--- a/test/zdtm/static/inotify_system_nodel.c
+++ b/test/zdtm/static/inotify_system_nodel.c
@@ -296,8 +296,7 @@ next_event:
int read_set(int inot_fd, char *event_set) {
int len;
if ((len = read(inot_fd, event_set, EVENT_BUF_LEN)) < 0) {
- pr_perror("read(%d, buf, %d) Failed, errno=%d : %s",
- inot_fd, EVENT_BUF_LEN, errno, strerror(errno));
+ pr_perror("read(%d, buf, %lu) Failed", inot_fd, EVENT_BUF_LEN);
return -1;
}
return len;
diff --git a/test/zdtm/static/ipc_namespace.c b/test/zdtm/static/ipc_namespace.c
index 99c25a706913..16d623d14d1e 100644
--- a/test/zdtm/static/ipc_namespace.c
+++ b/test/zdtm/static/ipc_namespace.c
@@ -71,7 +71,7 @@ static int read_ipc_sysctl(char *name, int *data, size_t size)
fd = open(name, O_RDONLY);
if (fd < 0) {
- pr_perror("Can't open %d", name);
+ pr_perror("Can't open %s", name);
return fd;
}
ret = read(fd, buf, 32);
@@ -203,7 +203,7 @@ static int rand_ipc_sysctl(char *name, unsigned int val)
fd = open(name, O_WRONLY);
if (fd < 0) {
- pr_perror("Can't open %d", name);
+ pr_perror("Can't open %s", name);
return fd;
}
sprintf(buf, "%d\n", val);
@@ -305,10 +305,10 @@ static void show_ipc_entry(struct ipc_ns *old, struct ipc_ns *new)
pr_perror("auto_msgmni differs: %d ---> %d",
old->auto_msgmni, new->auto_msgmni);
if (old->shm_ctlmax != new->shm_ctlmax)
- pr_perror("shm_ctlmax differs: %d ---> %d",
+ pr_perror("shm_ctlmax differs: %zu ---> %zu",
old->shm_ctlmax, new->shm_ctlmax);
if (old->shm_ctlall != new->shm_ctlall)
- pr_perror("shm_ctlall differs: %d ---> %d",
+ pr_perror("shm_ctlall differs: %zu ---> %zu",
old->shm_ctlall, new->shm_ctlall);
if (old->shm_ctlmni != new->shm_ctlmni)
pr_perror("shm_ctlmni differs: %d ---> %d",
diff --git a/test/zdtm/static/link10.c b/test/zdtm/static/link10.c
index 9f4c7f09934b..4bc2b5f2cc12 100644
--- a/test/zdtm/static/link10.c
+++ b/test/zdtm/static/link10.c
@@ -59,8 +59,9 @@ int main(int argc, char ** argv)
if (stat.st_ino != stat2.st_ino ||
stat.st_dev != stat2.st_dev) {
- fail("files are different: st_ino %d != %d or st_dev %d != %d",
- stat.st_ino, stat2.st_ino, stat.st_dev, stat2.st_dev);
+ fail("files are different: st_ino %lu != %lu or st_dev %lu != %lu",
+ (long unsigned)stat.st_ino, (long unsigned)stat2.st_ino,
+ (long unsigned)stat.st_dev, (long unsigned)stat2.st_dev);
}
pass();
diff --git a/test/zdtm/static/maps02.c b/test/zdtm/static/maps02.c
index 4c12bec991c3..571323547662 100644
--- a/test/zdtm/static/maps02.c
+++ b/test/zdtm/static/maps02.c
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
return -1;
if (m[i].orig_flags != m[i].new_flags) {
- pr_perror("Flags are changed %lx %lx -> %lx (%d)",
+ pr_perror("Flags are changed %lx %lx -> %lx (%zu)",
(unsigned long)m[i].start,
m[i].orig_flags, m[i].new_flags, i);
fail();
@@ -95,7 +95,7 @@ int main(int argc, char **argv)
}
if (m[i].orig_madv != m[i].new_madv) {
- pr_perror("Madvs are changed %lx %lx -> %lx (%d)",
+ pr_perror("Madvs are changed %lx %lx -> %lx (%zu)",
(unsigned long)m[i].start,
m[i].orig_madv, m[i].new_madv, i);
fail();
diff --git a/test/zdtm/static/mlock_setuid.c b/test/zdtm/static/mlock_setuid.c
index 92b313ed57ab..a6847a6540bc 100644
--- a/test/zdtm/static/mlock_setuid.c
+++ b/test/zdtm/static/mlock_setuid.c
@@ -21,7 +21,8 @@ int main(int argc, char **argv)
return -1;
}
- test_msg("Lock vma from %lx to %lx\n", start, start + MEM_SIZE);
+ test_msg("Lock vma from %p to %lx\n",
+ start, (unsigned long)start + MEM_SIZE);
ret = mlock(start, MEM_SIZE);
if (ret < 0) {
pr_perror("mlock");
diff --git a/test/zdtm/static/mntns_link_remap.c b/test/zdtm/static/mntns_link_remap.c
index 210188baea7c..dac89e601a4d 100644
--- a/test/zdtm/static/mntns_link_remap.c
+++ b/test/zdtm/static/mntns_link_remap.c
@@ -118,7 +118,7 @@ int ns_child(void *_arg)
#else
if (st1.st_nlink != 0) {
#endif
- pr_perror("Wrong number of links: %d", st1.st_nlink);
+ pr_perror("Wrong number of links: %lu", st1.st_nlink);
exit(1);
}
diff --git a/test/zdtm/static/mtime_mmap.c b/test/zdtm/static/mtime_mmap.c
index 6c97487ea283..64d92ca99d82 100644
--- a/test/zdtm/static/mtime_mmap.c
+++ b/test/zdtm/static/mtime_mmap.c
@@ -79,7 +79,7 @@ int main(int argc, char **argv)
mtime_new = fst.st_mtime;
/* time of last modification */
if (mtime_new <= mtime_old) {
- fail("mtime %d wasn't updated on mmapped %s file",
+ fail("mtime %ld wasn't updated on mmapped %s file",
mtime_new, filename);
goto failed;
}
@@ -102,8 +102,7 @@ int main(int argc, char **argv)
/* time of last modification */
if (fst.st_mtime != mtime_new) {
- fail("After migration, mtime changed to %d",
- fst.st_mtime);
+ fail("After migration, mtime changed to %ld", fst.st_mtime);
goto failed;
}
diff --git a/test/zdtm/static/overmount_dev.c b/test/zdtm/static/overmount_dev.c
index b3dd4e08be6a..a691032d63e8 100644
--- a/test/zdtm/static/overmount_dev.c
+++ b/test/zdtm/static/overmount_dev.c
@@ -71,7 +71,7 @@ int main(int argc, char **argv)
}
if (st.st_mode != mode || st.st_rdev != dev) {
- fail("%s is no longer the device file we had");
+ fail("%s is no longer the device file we had", path);
goto unlink;
}
diff --git a/test/zdtm/static/overmount_fifo.c b/test/zdtm/static/overmount_fifo.c
index 2de2a8a7ebc7..e452f1bae328 100644
--- a/test/zdtm/static/overmount_fifo.c
+++ b/test/zdtm/static/overmount_fifo.c
@@ -69,7 +69,7 @@ int main(int argc, char **argv)
}
if (st.st_mode != mode) {
- fail("%s is no longer the fifo we had");
+ fail("%s is no longer the fifo we had", path);
goto unlink;
}
diff --git a/test/zdtm/static/sem.c b/test/zdtm/static/sem.c
index a06649de210a..c3603cb3c8be 100644
--- a/test/zdtm/static/sem.c
+++ b/test/zdtm/static/sem.c
@@ -163,7 +163,7 @@ int main(int argc, char **argv)
goto out_destroy;
}
if (val[i] != 0) {
- fail("Non-zero sem %d value: %d", val);
+ fail("Non-zero sem %d value: %d", i, val[i]);
fail_count++;
}
}
diff --git a/test/zdtm/static/session00.c b/test/zdtm/static/session00.c
index bc8f00940990..2c79f0391599 100644
--- a/test/zdtm/static/session00.c
+++ b/test/zdtm/static/session00.c
@@ -226,7 +226,7 @@ int main(int argc, char ** argv)
pid = wait(&status);
if (pid != -1 || errno != ECHILD) {
- pr_perror("%d isn't waited");
+ pr_perror("%d isn't waited", pid);
err++;
}
diff --git a/test/zdtm/static/session02.c b/test/zdtm/static/session02.c
index 6c5e77121437..02458520240e 100644
--- a/test/zdtm/static/session02.c
+++ b/test/zdtm/static/session02.c
@@ -199,7 +199,7 @@ static int send_command(int id, enum commands op, int arg1, int arg2)
}
if (status) {
- pr_perror("The command(%d, %d, %d) failed");
+ pr_perror("The command(%d, %d, %d) failed", op, arg1, arg2);
goto err;
}
diff --git a/test/zdtm/static/session03.c b/test/zdtm/static/session03.c
index ef268e552845..2504d0179e0f 100644
--- a/test/zdtm/static/session03.c
+++ b/test/zdtm/static/session03.c
@@ -244,7 +244,7 @@ static int send_command(int id, enum commands op, int arg)
}
if (status) {
- pr_perror("The command(%d, %d, %d) failed");
+ pr_perror("The command(%d, %d) failed", op, arg);
goto err;
}
diff --git a/test/zdtm/static/sigaltstack.c b/test/zdtm/static/sigaltstack.c
index 5f0428d7855e..71b316ab2c92 100644
--- a/test/zdtm/static/sigaltstack.c
+++ b/test/zdtm/static/sigaltstack.c
@@ -43,7 +43,7 @@ static int sascmp(stack_t *old, stack_t *new)
static void show_ss(char *prefix, stack_t *s)
{
- test_msg("%20s: at %p (size %#8x flags %#2x)\n",
+ test_msg("%20s: at %p (size %8zu flags %#2x)\n",
prefix, s->ss_sp, s->ss_size, s->ss_flags);
}
diff --git a/test/zdtm/static/unlink_fstat00.c b/test/zdtm/static/unlink_fstat00.c
index f741099bf16c..88a864776219 100644
--- a/test/zdtm/static/unlink_fstat00.c
+++ b/test/zdtm/static/unlink_fstat00.c
@@ -64,7 +64,7 @@ int main(int argc, char ** argv)
}
/* Change file size */
if (fst.st_size != 0) {
- pr_perror("%s file size eq %d", fst.st_size);
+ pr_perror("%s file size eq %ld", filename, (long)fst.st_size);
goto failed;
}
@@ -111,12 +111,14 @@ int main(int argc, char ** argv)
/* Check file size */
if (fst.st_size != fsize) {
- fail("(via fstat): file size changed to %d", fst.st_size);
+ fail("(via fstat): file size changed to %ld",
+ (long)fst.st_size);
goto failed;
}
fst.st_size = lseek(fd, 0, SEEK_END);
if (fst.st_size != fsize) {
- fail("(via lseek): file size changed to %d", fst.st_size);
+ fail("(via lseek): file size changed to %ld",
+ (long)fst.st_size);
goto failed;
}
/* Check mode */
diff --git a/test/zdtm/static/unlink_fstat01.c b/test/zdtm/static/unlink_fstat01.c
index 104abec4f209..b82c8618b603 100644
--- a/test/zdtm/static/unlink_fstat01.c
+++ b/test/zdtm/static/unlink_fstat01.c
@@ -34,7 +34,7 @@ int main(int argc, char ** argv)
}
if (fst.st_size != 0) {
- pr_perror("%s file size eq %d", fst.st_size);
+ pr_perror("%s file size eq %ld", filename, (long)fst.st_size);
goto failed;
}
@@ -70,13 +70,13 @@ int main(int argc, char ** argv)
}
if (fst.st_size != fsize) {
- fail("(via fstat): file size changed to %d", fst.st_size);
+ fail("(via fstat): file size changed to %ld", fst.st_size);
goto failed;
}
fst.st_size = lseek(fd, 0, SEEK_END);
if (fst.st_size != fsize) {
- fail("(via lseek): file size changed to %d", fst.st_size);
+ fail("(via lseek): file size changed to %ld", fst.st_size);
goto failed;
}
diff --git a/test/zdtm/static/unlink_fstat02.c b/test/zdtm/static/unlink_fstat02.c
index dd18b8fb0517..ce32e9ecfa92 100644
--- a/test/zdtm/static/unlink_fstat02.c
+++ b/test/zdtm/static/unlink_fstat02.c
@@ -47,7 +47,7 @@ int main(int argc, char ** argv)
}
if (fst.st_size != 0) {
- pr_perror("%s file size eq %d", fst.st_size);
+ pr_perror("%s file size eq %ld", filename, fst.st_size);
goto failed;
}
@@ -86,13 +86,13 @@ int main(int argc, char ** argv)
}
if (fst.st_size != fsize) {
- fail("(via fstat): file size changed to %d", fst.st_size);
+ fail("(via fstat): file size changed to %ld", fst.st_size);
goto failed;
}
fst.st_size = lseek(fd[0], 0, SEEK_END);
if (fst.st_size != fsize) {
- fail("(via lseek): file size changed to %d", fst.st_size);
+ fail("(via lseek): file size changed to %ld", fst.st_size);
goto failed;
}
diff --git a/test/zdtm/static/unlink_fstat03.c b/test/zdtm/static/unlink_fstat03.c
index 06268e3e6540..8b3bf8dccf5f 100644
--- a/test/zdtm/static/unlink_fstat03.c
+++ b/test/zdtm/static/unlink_fstat03.c
@@ -44,7 +44,7 @@ int main(int argc, char ** argv)
}
if (fst.st_size != 0) {
- pr_perror("%s file size eq %d", fst.st_size);
+ pr_perror("%s file size eq %ld", filename, fst.st_size);
goto failed;
}
@@ -84,13 +84,13 @@ int main(int argc, char ** argv)
}
if (fst2.st_size != fsize) {
- fail("(via fstat): file size changed to %d", fst.st_size);
+ fail("(via fstat): file size changed to %ld", fst.st_size);
goto failed;
}
fst2.st_size = lseek(fd, 0, SEEK_END);
if (fst2.st_size != fsize) {
- fail("(via lseek): file size changed to %d", fst.st_size);
+ fail("(via lseek): file size changed to %ld", fst.st_size);
goto failed;
}
diff --git a/test/zdtm/static/unlink_largefile.c b/test/zdtm/static/unlink_largefile.c
index b1f8079bc340..8f0bd87495e2 100644
--- a/test/zdtm/static/unlink_largefile.c
+++ b/test/zdtm/static/unlink_largefile.c
@@ -28,8 +28,7 @@ int main(int argc, char ** argv)
}
if (lseek64(fd, offset, SEEK_SET) < 0) {
- pr_perror("can't lseek %s, offset= %x", filename,
- offset);
+ pr_perror("can't lseek %s, offset= %lx", filename, offset);
goto failed;
}
diff --git a/test/zdtm/static/unlink_regular00.c b/test/zdtm/static/unlink_regular00.c
index 6e97df2d1d0d..383fabbf0c66 100644
--- a/test/zdtm/static/unlink_regular00.c
+++ b/test/zdtm/static/unlink_regular00.c
@@ -88,7 +88,8 @@ int main(int argc, char ** argv)
}
if (strcmp(buf, MSG)) {
- fail("content differs: %s, %s, sizeof=%d", buf, MSG, sizeof(MSG));
+ fail("content differs: %s, %s, sizeof=%zu",
+ buf, MSG, sizeof(MSG));
goto close_file;
}
diff --git a/test/zdtm/static/write_read10.c b/test/zdtm/static/write_read10.c
index 8af581dadb48..4e8a67e84ccb 100644
--- a/test/zdtm/static/write_read10.c
+++ b/test/zdtm/static/write_read10.c
@@ -116,7 +116,8 @@ int main(int argc, char ** argv)
}
if (unlink(filename) != -1 || errno != ENOENT) {
- fail("file %s should have been deleted before migration: unlink: %m\n");
+ fail("file %s should have been deleted before migration: unlink: %m\n",
+ filename);
goto out_noclose;
}
diff --git a/test/zdtm/transition/maps007.c b/test/zdtm/transition/maps007.c
index 96e401e95ab1..04568fb998e1 100644
--- a/test/zdtm/transition/maps007.c
+++ b/test/zdtm/transition/maps007.c
@@ -84,7 +84,8 @@ int main(int argc, char **argv)
/* shm->delta must be always bigger than MAX_DELTA */
futex_wait_while_lt(&shm->delta, MAX_DELTA + 2);
else if (count % 100 == 0)
- test_msg("count %d delta %d\n", count, futex_get(&shm->delta)); /* heartbeat */
+ test_msg("count %llu delta %d\n",
+ count, futex_get(&shm->delta)); /* heartbeat */
if (futex_get(&shm->stop) && atomic_get(&shm->delta.raw) == MAX_DELTA)
break;
@@ -123,7 +124,7 @@ int main(int argc, char **argv)
t[0] = lrand48();
}
}
- test_msg("count %d\n", count);
+ test_msg("count %llu\n", count);
if (child == 0) {
if (!test_go())
diff --git a/test/zdtm/transition/pipe_loop00.c b/test/zdtm/transition/pipe_loop00.c
index cce60270e2ed..01964c618bd7 100644
--- a/test/zdtm/transition/pipe_loop00.c
+++ b/test/zdtm/transition/pipe_loop00.c
@@ -113,7 +113,7 @@ int main(int argc, char **argv)
if (errno == EINTR)
continue;
else {
- fail("write failed: %m\n", i);
+ fail("write failed\n");
ret = 1;
break;
}
diff --git a/test/zdtm/transition/socket_loop00.c b/test/zdtm/transition/socket_loop00.c
index 9bc3d6e28d87..1d7097bb9521 100644
--- a/test/zdtm/transition/socket_loop00.c
+++ b/test/zdtm/transition/socket_loop00.c
@@ -115,7 +115,7 @@ int main(int argc, char **argv)
if (errno == EINTR)
continue;
else {
- fail("write failed: %m\n", i);
+ fail("write failed\n");
ret = 1;
break;
}
--
2.9.0
More information about the CRIU
mailing list