Commit a207bee1 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Cyrill Gorcunov

cr-dump.c: fix printf format warnings

cr-dump.c: In function ‘dump_one_reg_file’:
cr-dump.c:128:2: error: format ‘%8x’ expects type ‘unsigned int’, but argument 5 has type ‘long unsigned int’
cr-dump.c: In function ‘dump_one_pipe’:
cr-dump.c:223:2: error: format ‘%d’ expects type ‘int’, but argument 2 has type ‘long unsigned int’
cr-dump.c:237:3: error: format ‘%8lx’ expects type ‘long unsigned int’, but argument 2 has type ‘u32’
cr-dump.c:237:3: error: format ‘%8lx’ expects type ‘long unsigned int’, but argument 3 has type ‘u32’
cr-dump.c:237:3: error: format ‘%8lx’ expects type ‘long unsigned int’, but argument 4 has type ‘u32’
cr-dump.c:237:3: error: format ‘%8lx’ expects type ‘long unsigned int’, but argument 5 has type ‘u32’
cr-dump.c:240:3: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
cr-dump.c: In function ‘dump_one_fd’:
cr-dump.c:257:3: error: format ‘%d’ expects type ‘int’, but argument 5 has type ‘long unsigned int’
cr-dump.c:262:3: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
cr-dump.c:272:4: error: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long unsigned int’
cr-dump.c:286:4: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
cr-dump.c:295:2: error: format ‘%d’ expects type ‘int’, but argument 4 has type ‘long unsigned int’
cr-dump.c: In function ‘dump_task_files’:
cr-dump.c:340:3: error: too few arguments for format
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent b44cd588
...@@ -125,7 +125,7 @@ static int dump_one_reg_file(int type, struct fd_parms *p, int lfd, ...@@ -125,7 +125,7 @@ static int dump_one_reg_file(int type, struct fd_parms *p, int lfd,
else else
memzero(e.id, FD_ID_SIZE); memzero(e.id, FD_ID_SIZE);
pr_info("fdinfo: type: %2x len: %2x flags: %4x pos: %8x addr: %16lx\n", pr_info("fdinfo: type: %2x len: %2x flags: %4x pos: %8lx addr: %16lx\n",
type, len, p->flags, p->pos, p->fd_name); type, len, p->flags, p->pos, p->fd_name);
if (write_img(cr_fdset->fds[CR_FD_FDINFO], &e)) if (write_img(cr_fdset->fds[CR_FD_FDINFO], &e))
...@@ -220,7 +220,7 @@ static int dump_one_pipe(struct fd_parms *p, unsigned int id, int lfd, ...@@ -220,7 +220,7 @@ static int dump_one_pipe(struct fd_parms *p, unsigned int id, int lfd,
struct pipe_entry e; struct pipe_entry e;
int ret = -1; int ret = -1;
pr_info("Dumping pipe %d/%x flags %x\n", p->fd_name, id, p->flags); pr_info("Dumping pipe %ld/%x flags %x\n", p->fd_name, id, p->flags);
e.fd = p->fd_name; e.fd = p->fd_name;
e.pipeid = id; e.pipeid = id;
...@@ -234,10 +234,10 @@ static int dump_one_pipe(struct fd_parms *p, unsigned int id, int lfd, ...@@ -234,10 +234,10 @@ static int dump_one_pipe(struct fd_parms *p, unsigned int id, int lfd,
err: err:
if (!ret) if (!ret)
pr_info("Dumped pipe: fd: %8lx pipeid: %8lx flags: %8lx bytes: %8lx\n", pr_info("Dumped pipe: fd: %8x pipeid: %8x flags: %8x bytes: %8x\n",
e.fd, e.pipeid, e.flags, e.bytes); e.fd, e.pipeid, e.flags, e.bytes);
else else
pr_err("Dumping pipe %d/%x flags %x\n", p->fd_name, id, p->flags); pr_err("Dumping pipe %ld/%x flags %x\n", p->fd_name, id, p->flags);
return ret; return ret;
} }
...@@ -254,12 +254,12 @@ static int dump_one_fd(pid_t pid, int pid_fd_dir, int lfd, ...@@ -254,12 +254,12 @@ static int dump_one_fd(pid_t pid, int pid_fd_dir, int lfd,
if (err != 1) if (err != 1)
return err; return err;
pr_perror("Failed to open %d/%d", pid_fd_dir, p->fd_name); pr_perror("Failed to open %d/%ld", pid_fd_dir, p->fd_name);
return -1; return -1;
} }
if (fstat(lfd, &st_buf) < 0) { if (fstat(lfd, &st_buf) < 0) {
pr_perror("Can't get stat on %d", p->fd_name); pr_perror("Can't get stat on %ld", p->fd_name);
goto out_close; goto out_close;
} }
...@@ -269,7 +269,7 @@ static int dump_one_fd(pid_t pid, int pid_fd_dir, int lfd, ...@@ -269,7 +269,7 @@ static int dump_one_fd(pid_t pid, int pid_fd_dir, int lfd,
/* skip only standard destriptors */ /* skip only standard destriptors */
if (p->fd_name < 3) { if (p->fd_name < 3) {
err = 0; err = 0;
pr_info("... Skipping tty ... %d/%d\n", pr_info("... Skipping tty ... %d/%ld\n",
pid_fd_dir, p->fd_name); pid_fd_dir, p->fd_name);
goto out_close; goto out_close;
} }
...@@ -283,7 +283,7 @@ static int dump_one_fd(pid_t pid, int pid_fd_dir, int lfd, ...@@ -283,7 +283,7 @@ static int dump_one_fd(pid_t pid, int pid_fd_dir, int lfd,
if (S_ISFIFO(st_buf.st_mode)) { if (S_ISFIFO(st_buf.st_mode)) {
if (fstatfs(lfd, &stfs_buf) < 0) { if (fstatfs(lfd, &stfs_buf) < 0) {
pr_perror("Can't fstatfs on %d", p->fd_name); pr_perror("Can't fstatfs on %ld", p->fd_name);
return -1; return -1;
} }
...@@ -292,7 +292,7 @@ static int dump_one_fd(pid_t pid, int pid_fd_dir, int lfd, ...@@ -292,7 +292,7 @@ static int dump_one_fd(pid_t pid, int pid_fd_dir, int lfd,
} }
err: err:
pr_err("Can't dump file %d of that type [%x]\n", p->fd_name, st_buf.st_mode); pr_err("Can't dump file %ld of that type [%x]\n", p->fd_name, st_buf.st_mode);
out_close: out_close:
close_safe(&lfd); close_safe(&lfd);
...@@ -337,7 +337,7 @@ static int dump_task_files(pid_t pid, int pid_dir, struct cr_fdset *cr_fdset) ...@@ -337,7 +337,7 @@ static int dump_task_files(pid_t pid, int pid_dir, struct cr_fdset *cr_fdset)
pr_info("----------------------------------------\n"); pr_info("----------------------------------------\n");
if (dump_cwd(pid_dir, cr_fdset)) { if (dump_cwd(pid_dir, cr_fdset)) {
pr_perror("Can't dump %d's cwd %s", pid); pr_perror("Can't dump %d's cwd", pid);
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment