mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 05:18:00 +00:00
arm/test: fix printing formats in tests
Fixes: cow01.c: In function 'parent_check': ../lib/zdtmtst.h:120:11: error: format '%lx' expects argument of type 'long unsigned int', but argument 7 has type 'uint64_t {aka long long unsigned int}' [-Werror=format=] test_msg("FAIL: %s:%d: " format " (errno = %d (%s))\n", \ ^ cow01.c:287:5: note: in expansion of macro 'fail' fail("%s[%#x]: %p is not COW-ed (pagemap of " ^~~~ In file included from inotify_system.c:14:0: inotify_system.c: In function 'read_set': ../lib/zdtmtst.h:117:11: error: format '%lu' expects argument of type 'long unsigned int', but argument 5 has type 'unsigned int' [-Werror=form at=] test_msg("ERR: %s:%d: " format " (errno = %d (%s))\n", \ ^ inotify_system.c:299:3: note: in expansion of macro 'pr_perror' pr_perror("read(%d, buf, %lu) Failed, errno=%d", ^~~~~~~~~ deleted_dev.c:53:36: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type '__dev_t {aka long long unsigned int}' [-Werror=format=] test_msg("mode %x want %x, dev %lx want %lx\n", ^ deleted_dev.c:53:45: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'dev_t {aka long long unsigned i nt}' [-Werror=format=] test_msg("mode %x want %x, dev %lx want %lx\n", ^ ../lib/zdtmtst.h:117:11: error: format '%lx' expects argument of type 'long unsigned int', but argument 5 has type 'off64_t {aka long long int ' [-Werror=format=] test_msg("ERR: %s:%d: " format " (errno = %d (%s))\n", \ ^ Nothing really interesting, but printings with right format specifier. Signed-off-by: Dmitry Safonov <0x7f454c46@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
0ca79b6d6c
commit
a007f53bc1
@ -188,9 +188,10 @@ static int check_fd(struct autofs_params *p)
|
||||
}
|
||||
|
||||
if (st.st_dev != p->fd_stat.st_dev) {
|
||||
skip("%s: st_dev differs: %lu != %lu "
|
||||
skip("%s: st_dev differs: %llu != %llu "
|
||||
"(waiting for \"device namespaces\")", p->mountpoint,
|
||||
st.st_dev, p->fd_stat.st_dev);
|
||||
(long long unsigned)st.st_dev,
|
||||
(long long unsigned)p->fd_stat.st_dev);
|
||||
// ret++;
|
||||
}
|
||||
if (st.st_mode != p->fd_stat.st_mode) {
|
||||
@ -200,7 +201,7 @@ static int check_fd(struct autofs_params *p)
|
||||
}
|
||||
if (st.st_nlink != p->fd_stat.st_nlink) {
|
||||
pr_err("%s: st_nlink differs: %ld != %ld\n", p->mountpoint,
|
||||
st.st_nlink, p->fd_stat.st_nlink);
|
||||
(long)st.st_nlink, (long)p->fd_stat.st_nlink);
|
||||
ret++;
|
||||
}
|
||||
if (st.st_uid != p->fd_stat.st_uid) {
|
||||
@ -214,8 +215,9 @@ static int check_fd(struct autofs_params *p)
|
||||
ret++;
|
||||
}
|
||||
if (st.st_rdev != p->fd_stat.st_rdev) {
|
||||
pr_err("%s: st_rdev differs: %ld != %ld\n", p->mountpoint,
|
||||
st.st_rdev, p->fd_stat.st_rdev);
|
||||
pr_err("%s: st_rdev differs: %lld != %lld\n", p->mountpoint,
|
||||
(long long)st.st_rdev,
|
||||
(long long)p->fd_stat.st_rdev);
|
||||
ret++;
|
||||
}
|
||||
if (st.st_size != p->fd_stat.st_size) {
|
||||
@ -484,7 +486,7 @@ static int automountd_loop(int pipe, const char *mountpoint, struct autofs_param
|
||||
return -EINVAL;
|
||||
}
|
||||
if (bytes != sizeof(*packet)) {
|
||||
pr_err("read less than expected: %ld\n", bytes);
|
||||
pr_err("read less than expected: %zd\n", bytes);
|
||||
return -EINVAL;
|
||||
}
|
||||
err = automountd_serve(mountpoint, param, packet);
|
||||
|
@ -4,6 +4,7 @@
|
||||
#include <string.h>
|
||||
#include <signal.h>
|
||||
#include <unistd.h>
|
||||
#include <inttypes.h>
|
||||
#include <sys/wait.h>
|
||||
#include <linux/limits.h>
|
||||
#include <sys/user.h>
|
||||
@ -285,7 +286,7 @@ static int parent_check(struct test_cases *test_cases, int fd)
|
||||
if (is_cow_ret == 1) {
|
||||
errno = 0;
|
||||
fail("%s[%#x]: %p is not COW-ed (pagemap of "
|
||||
"child=[%#08lx], parent=[%#08lx])",
|
||||
"child=[%"PRIx64"], parent=[%"PRIx64"])",
|
||||
test_cases->tname, i, addr + i * PAGE_SIZE,
|
||||
map_child, map_parent);
|
||||
}
|
||||
|
@ -50,8 +50,10 @@ 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 %lx want %lx\n",
|
||||
st.st_mode, mode, st.st_rdev, dev);
|
||||
test_msg("mode %x want %x, dev %llx want %llx\n",
|
||||
st.st_mode, mode,
|
||||
(long long unsigned)st.st_rdev,
|
||||
(long long unsigned)dev);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "zdtmtst.h"
|
||||
|
||||
@ -65,7 +66,7 @@ int main(int argc, char *argv[])
|
||||
exit(1);
|
||||
}
|
||||
|
||||
test_msg("created eventfd with %lx\n", v);
|
||||
test_msg("created eventfd with %"PRIu64"\n", v);
|
||||
|
||||
ret = write(efd, &v, sizeof(v));
|
||||
if (ret != sizeof(v)) {
|
||||
|
@ -297,7 +297,7 @@ 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, %lu) Failed, errno=%d",
|
||||
inot_fd, EVENT_BUF_LEN, errno);
|
||||
inot_fd, (unsigned long)EVENT_BUF_LEN, errno);
|
||||
return -1;
|
||||
}
|
||||
return len;
|
||||
|
@ -296,7 +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, %lu) Failed", inot_fd, EVENT_BUF_LEN);
|
||||
pr_perror("read(%d, buf, %lu) Failed",
|
||||
inot_fd, (unsigned long)EVENT_BUF_LEN);
|
||||
return -1;
|
||||
}
|
||||
return len;
|
||||
|
@ -118,7 +118,8 @@ int ns_child(void *_arg)
|
||||
#else
|
||||
if (st1.st_nlink != 0) {
|
||||
#endif
|
||||
pr_perror("Wrong number of links: %lu", st1.st_nlink);
|
||||
pr_perror("Wrong number of links: %lu",
|
||||
(long unsigned)st1.st_nlink);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
@ -28,7 +28,8 @@ int main(int argc, char ** argv)
|
||||
}
|
||||
|
||||
if (lseek64(fd, offset, SEEK_SET) < 0) {
|
||||
pr_perror("can't lseek %s, offset= %lx", filename, offset);
|
||||
pr_perror("can't lseek %s, offset= %llx", filename,
|
||||
(long long unsigned)offset);
|
||||
goto failed;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user