version 1.31, 2015/01/16 06:40:09 |
version 1.32, 2015/04/18 18:28:37 |
|
|
static int |
static int |
rpid(const char *p) |
rpid(const char *p) |
{ |
{ |
|
const char *errstr; |
static int first; |
static int first; |
|
pid_t pid; |
|
|
if (first++) { |
if (first++) { |
warnx("only one -g or -p flag is permitted."); |
warnx("only one -g or -p flag is permitted."); |
|
|
warnx("illegal process id."); |
warnx("illegal process id."); |
usage(); |
usage(); |
} |
} |
return(atoi(p)); |
pid = strtonum(p, 1, INT_MAX, &errstr); |
|
if (errstr) { |
|
warnx("illegal process id: %s", errstr); |
|
usage(); |
|
} |
|
return pid; |
} |
} |
|
|
static void |
static void |