summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/lpc/cmds.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1996-11-03 23:24:14 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1996-11-03 23:24:14 +0000
commitd72e5b4dcb4aa82963fd3ce24000a3197269442f (patch)
treee787b78982c67b5d53ce5899cd0f71510b2624cc /usr.sbin/lpr/lpc/cmds.c
parente0ef2b64c7bd3c27ea81ce04d46444656105a9c6 (diff)
Improve portability by using ANSI/POSIX interfaces when possible.
Diffstat (limited to 'usr.sbin/lpr/lpc/cmds.c')
-rw-r--r--usr.sbin/lpr/lpc/cmds.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.sbin/lpr/lpc/cmds.c b/usr.sbin/lpr/lpc/cmds.c
index 512d5c50005..a03238d72ca 100644
--- a/usr.sbin/lpr/lpc/cmds.c
+++ b/usr.sbin/lpr/lpc/cmds.c
@@ -181,9 +181,12 @@ abortpr(dis)
goto out;
}
(void) fclose(fp);
- if (kill(pid = atoi(line), SIGTERM) < 0)
- printf("\tWarning: daemon (pid %d) not killed\n", pid);
- else
+ if (kill(pid = atoi(line), SIGTERM) < 0) {
+ if (errno == ESRCH)
+ printf("\tno daemon to abort\n");
+ else
+ printf("\tWarning: daemon (pid %d) not killed\n", pid);
+ } else
printf("\tdaemon (pid %d) killed\n", pid);
out:
seteuid(uid);
@@ -1051,7 +1054,7 @@ doarg(job)
* Look for a job item consisting of system name, colon, number
* (example: ucbarpa:114)
*/
- if ((cp = index(job, ':')) != NULL) {
+ if ((cp = strchr(job, ':')) != NULL) {
machine = job;
*cp++ = '\0';
job = cp;