Commit 3c18e396 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

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: 's avatarKir Kolyshkin <kir@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 4d1c3f98
...@@ -127,7 +127,7 @@ static int setup_direct(struct autofs_params *p) ...@@ -127,7 +127,7 @@ static int setup_direct(struct autofs_params *p)
} }
p->fd = open(path, O_CREAT | O_EXCL, 0600); p->fd = open(path, O_CREAT | O_EXCL, 0600);
if (p->fd < 0) { 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; return -errno;
} }
if (fstat(p->fd, &p->fd_stat)) { if (fstat(p->fd, &p->fd_stat)) {
...@@ -149,7 +149,7 @@ static int setup_indirect(struct autofs_params *p) ...@@ -149,7 +149,7 @@ static int setup_indirect(struct autofs_params *p)
} }
p->fd = open(path, O_CREAT | O_EXCL, 0600); p->fd = open(path, O_CREAT | O_EXCL, 0600);
if (p->fd < 0) { 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; return -errno;
} }
if (fstat(p->fd, &p->fd_stat)) { if (fstat(p->fd, &p->fd_stat)) {
...@@ -301,7 +301,7 @@ static int autofs_dev_open(void) ...@@ -301,7 +301,7 @@ static int autofs_dev_open(void)
fd = open(AUTOFS_DEV, O_RDONLY); fd = open(AUTOFS_DEV, O_RDONLY);
if (fd == -1) { if (fd == -1) {
pr_perror("failed to open /dev/autofs\n"); pr_perror("failed to open /dev/autofs");
return -errno; return -errno;
} }
return fd; return fd;
...@@ -323,7 +323,7 @@ static int autofs_open_mount(int devid, const char *mountpoint) ...@@ -323,7 +323,7 @@ static int autofs_open_mount(int devid, const char *mountpoint)
strcpy(param->path, mountpoint); strcpy(param->path, mountpoint);
if (ioctl(autofs_dev, AUTOFS_DEV_IOCTL_OPENMOUNT, param) < 0) { 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; return -errno;
} }
...@@ -564,7 +564,7 @@ static int automountd(struct autofs_params *p, int control_fd) ...@@ -564,7 +564,7 @@ static int automountd(struct autofs_params *p, int control_fd)
ret = 0; ret = 0;
if (write(control_fd, &ret, sizeof(ret)) != sizeof(ret)) { if (write(control_fd, &ret, sizeof(ret)) != sizeof(ret)) {
pr_perror("failed to send result\n"); pr_perror("failed to send result");
goto err; goto err;
} }
close(control_fd); close(control_fd);
...@@ -572,7 +572,7 @@ static int automountd(struct autofs_params *p, int control_fd) ...@@ -572,7 +572,7 @@ static int automountd(struct autofs_params *p, int control_fd)
err: err:
if (write(control_fd, &ret, sizeof(ret) != sizeof(ret))) { 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 -errno;
} }
return ret; return ret;
...@@ -593,7 +593,7 @@ static int start_automounter(struct autofs_params *p) ...@@ -593,7 +593,7 @@ static int start_automounter(struct autofs_params *p)
pid = test_fork(); pid = test_fork();
switch (pid) { switch (pid) {
case -1: case -1:
pr_perror("failed to fork\n"); pr_perror("failed to fork");
return -1; return -1;
case 0: case 0:
close(control_fd[0]); close(control_fd[0]);
...@@ -679,7 +679,7 @@ static int setup_catatonic(struct autofs_params *p) ...@@ -679,7 +679,7 @@ static int setup_catatonic(struct autofs_params *p)
p->fd = open(path, O_CREAT | O_EXCL, 0600); p->fd = open(path, O_CREAT | O_EXCL, 0600);
if (p->fd >= 0) { 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; return -EINVAL;
} }
free(path); free(path);
......
...@@ -90,11 +90,11 @@ int main(int argc, char **argv) ...@@ -90,11 +90,11 @@ int main(int argc, char **argv)
test_waitsig(); test_waitsig();
if (umount(path)) { if (umount(path)) {
pr_perror("Unable to umount %s\n", path); pr_perror("Unable to umount %s", path);
return 1; return 1;
} }
if (umount(dirname)) { if (umount(dirname)) {
pr_perror("Unable to umount %s\n", dirname); pr_perror("Unable to umount %s", dirname);
return 1; return 1;
} }
......
...@@ -175,7 +175,7 @@ int main(int argc, char ** argv) ...@@ -175,7 +175,7 @@ int main(int argc, char ** argv)
} }
if (WTERMSIG(status) != SIGSYS) { if (WTERMSIG(status) != SIGSYS) {
pr_perror("expected SIGSYS, got %d\n", WTERMSIG(status)); pr_perror("expected SIGSYS, got %d", WTERMSIG(status));
exit(1); exit(1);
} }
......
...@@ -31,12 +31,12 @@ static int client(const char *iter) ...@@ -31,12 +31,12 @@ static int client(const char *iter)
strcpy(addr.sun_path, filename); strcpy(addr.sun_path, filename);
if (connect(sk, (void *)&addr, sizeof(struct sockaddr_un)) < 0) { 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; return 1;
} }
if (send(sk, MSG, sizeof(MSG), 0) != sizeof(MSG)) { if (send(sk, MSG, sizeof(MSG), 0) != sizeof(MSG)) {
pr_perror("send failed %s\n", iter); pr_perror("send failed %s", iter);
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