mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-22 01:31:34 +00:00
test/zdtm: pr_perror() sanitization
Don't append \n as pr_perror() already does it for us. travis-ci: success for more pr_perror() usage fixes Signed-off-by: Kir Kolyshkin <kir@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
4d1c3f9834
commit
3c18e39660
4 changed files with 13 additions and 13 deletions
|
|
@ -127,7 +127,7 @@ static int setup_direct(struct autofs_params *p)
|
|||
}
|
||||
p->fd = open(path, O_CREAT | O_EXCL, 0600);
|
||||
if (p->fd < 0) {
|
||||
pr_perror("%d: failed to open file %s\n", getpid(), path);
|
||||
pr_perror("%d: failed to open file %s", getpid(), path);
|
||||
return -errno;
|
||||
}
|
||||
if (fstat(p->fd, &p->fd_stat)) {
|
||||
|
|
@ -149,7 +149,7 @@ static int setup_indirect(struct autofs_params *p)
|
|||
}
|
||||
p->fd = open(path, O_CREAT | O_EXCL, 0600);
|
||||
if (p->fd < 0) {
|
||||
pr_perror("%d: failed to open file %s\n", getpid(), path);
|
||||
pr_perror("%d: failed to open file %s", getpid(), path);
|
||||
return -errno;
|
||||
}
|
||||
if (fstat(p->fd, &p->fd_stat)) {
|
||||
|
|
@ -301,7 +301,7 @@ static int autofs_dev_open(void)
|
|||
|
||||
fd = open(AUTOFS_DEV, O_RDONLY);
|
||||
if (fd == -1) {
|
||||
pr_perror("failed to open /dev/autofs\n");
|
||||
pr_perror("failed to open /dev/autofs");
|
||||
return -errno;
|
||||
}
|
||||
return fd;
|
||||
|
|
@ -323,7 +323,7 @@ static int autofs_open_mount(int devid, const char *mountpoint)
|
|||
strcpy(param->path, mountpoint);
|
||||
|
||||
if (ioctl(autofs_dev, AUTOFS_DEV_IOCTL_OPENMOUNT, param) < 0) {
|
||||
pr_perror("failed to open autofs mount %s\n", mountpoint);
|
||||
pr_perror("failed to open autofs mount %s", mountpoint);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
|
|
@ -564,7 +564,7 @@ static int automountd(struct autofs_params *p, int control_fd)
|
|||
|
||||
ret = 0;
|
||||
if (write(control_fd, &ret, sizeof(ret)) != sizeof(ret)) {
|
||||
pr_perror("failed to send result\n");
|
||||
pr_perror("failed to send result");
|
||||
goto err;
|
||||
}
|
||||
close(control_fd);
|
||||
|
|
@ -572,7 +572,7 @@ static int automountd(struct autofs_params *p, int control_fd)
|
|||
|
||||
err:
|
||||
if (write(control_fd, &ret, sizeof(ret) != sizeof(ret))) {
|
||||
pr_perror("failed to send result\n");
|
||||
pr_perror("failed to send result");
|
||||
return -errno;
|
||||
}
|
||||
return ret;
|
||||
|
|
@ -593,7 +593,7 @@ static int start_automounter(struct autofs_params *p)
|
|||
pid = test_fork();
|
||||
switch (pid) {
|
||||
case -1:
|
||||
pr_perror("failed to fork\n");
|
||||
pr_perror("failed to fork");
|
||||
return -1;
|
||||
case 0:
|
||||
close(control_fd[0]);
|
||||
|
|
@ -679,7 +679,7 @@ static int setup_catatonic(struct autofs_params *p)
|
|||
|
||||
p->fd = open(path, O_CREAT | O_EXCL, 0600);
|
||||
if (p->fd >= 0) {
|
||||
pr_perror("%d: was able to open file %s on catatonic mount\n", getpid(), path);
|
||||
pr_perror("%d: was able to open file %s on catatonic mount", getpid(), path);
|
||||
return -EINVAL;
|
||||
}
|
||||
free(path);
|
||||
|
|
|
|||
|
|
@ -90,11 +90,11 @@ int main(int argc, char **argv)
|
|||
test_waitsig();
|
||||
|
||||
if (umount(path)) {
|
||||
pr_perror("Unable to umount %s\n", path);
|
||||
pr_perror("Unable to umount %s", path);
|
||||
return 1;
|
||||
}
|
||||
if (umount(dirname)) {
|
||||
pr_perror("Unable to umount %s\n", dirname);
|
||||
pr_perror("Unable to umount %s", dirname);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ int main(int argc, char ** argv)
|
|||
}
|
||||
|
||||
if (WTERMSIG(status) != SIGSYS) {
|
||||
pr_perror("expected SIGSYS, got %d\n", WTERMSIG(status));
|
||||
pr_perror("expected SIGSYS, got %d", WTERMSIG(status));
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,12 +31,12 @@ static int client(const char *iter)
|
|||
strcpy(addr.sun_path, filename);
|
||||
|
||||
if (connect(sk, (void *)&addr, sizeof(struct sockaddr_un)) < 0) {
|
||||
pr_perror("connect failed %s\n", iter);
|
||||
pr_perror("connect failed %s", iter);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (send(sk, MSG, sizeof(MSG), 0) != sizeof(MSG)) {
|
||||
pr_perror("send failed %s\n", iter);
|
||||
pr_perror("send failed %s", iter);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue