From 3ab5048d8818156d9027e8e4d323962bd63dd7d5 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 6 Dec 1997 14:42:58 +0000 Subject: err(3) already includes strerror(errno) and a trailing \n --- usr.bin/truss/setup.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'usr.bin/truss') diff --git a/usr.bin/truss/setup.c b/usr.bin/truss/setup.c index 29cbf53..3ee5183 100644 --- a/usr.bin/truss/setup.c +++ b/usr.bin/truss/setup.c @@ -3,7 +3,7 @@ * I'm afraid. */ /* - * $Id: setup.c,v 1.1 1997/12/06 05:23:05 sef Exp $ + * $Id: setup.c,v 1.2 1997/12/06 08:01:00 sef Exp $ */ #include @@ -39,16 +39,16 @@ setup_and_wait(char *command[]) { pid = vfork(); if (pid == -1) { - err(1, "vfork failed\n"); + err(1, "vfork failed"); } if (pid == 0) { /* Child */ int mask = S_EXEC | S_EXIT; fd = open("/proc/curproc/mem", O_WRONLY); if (fd == -1) - err(2, "cannot open /proc/curproc/mem: %s\n", strerror(errno)); + err(2, "cannot open /proc/curproc/mem"); fcntl(fd, F_SETFD, 1); if (ioctl(fd, PIOCBIS, &mask) == -1) - err(3, "PIOCBIS: %s\n", strerror(errno)); + err(3, "PIOCBIS"); execvp(command[0], command); mask = ~0; ioctl(fd, PIOCBIC, &mask); @@ -66,9 +66,9 @@ setup_and_wait(char *command[]) { sprintf(buf, "/proc/%d/mem", pid); if ((fd = open(buf, O_RDWR)) == -1) - err(5, "cannot open %s: %s\n", buf, strerror(errno)); + err(5, "cannot open %s", buf); if (ioctl(fd, PIOCWAIT, &pfs) == -1) - err(6, "PIOCWAIT: %s\n", strerror(errno)); + err(6, "PIOCWAIT"); if (pfs.why == S_EXIT) { int zero = 0; fprintf(stderr, "process exited before exec'ing\n"); -- cgit v1.1