--- - branch: MAIN date: Sun Aug 30 19:35:10 UTC 2020 files: - new: '1.32' old: '1.31' path: src/bin/kill/kill.c pathrev: src/bin/kill/kill.c@1.32 type: modified id: 20200830T193510Z.44394dc02f35a6c973edf667cdf88fbb67a7e8ba log: | 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. module: src subject: 'CVS commit: src/bin/kill' unixtime: '1598816110' user: kre