Module Name: src Committed By: kre Date: Sun Aug 30 19:35:10 UTC 2020
Modified Files: src/bin/kill: kill.c Log Message: Every integer that fits within a pid_t is a potential "pid" arg to kill. That means we cannot use (pid_t)-1 as an error indicator, as that's a valid pid to use (described as working in kill(1) - yet it wasn't working in /bin/kill (nor sh's builtin kill, which is essentially the same code). This is even required to work by POSIX. So change processnum() (the parser/validator for the pid args) to take a pointer to a pid_t and return the pid that way, leaving the return value of the (now int) function to indicate just ok/error. While here, fix the validation a little ('' is no longer an accepted alias for 0) and in case of an error from kill(2) have the error message indicate whether the kill was targeted at a pid of a pgrp. To generate a diff of this commit: cvs rdiff -u -r1.31 -r1.32 src/bin/kill/kill.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.