Signed-off-by: Alejandro Colomar <alx@kernel.org>
return 0;
}
buf[len] = '\0';
- if (get_pid (buf, &pid) == 0) {
+ if (get_pid(buf, &pid) == -1) {
if (log) {
(void) fprintf (shadow_logfd,
"%s: existing lock file %s with an invalid PID '%s'\n",
|| (0 != errno)
|| (val < 1)
|| (/*@+longintegral@*/val != (pid_t)val)/*@=longintegral@*/) {
- return 0;
+ return -1;
}
*pid = val;
- return 1;
+ return 0;
}
/*
char proc_dir_name[32];
pid_t target;
- if (get_pid(pidstr, &target) == 0)
+ if (get_pid(pidstr, &target) == -1)
return -ENOENT;
/* max string length is 6 + 10 + 1 + 1 = 18, allocate 32 bytes */
}
/* Check if this is a valid PID */
- if (get_pid (tmp_d_name, &pid) == 0) {
+ if (get_pid(tmp_d_name, &pid) == -1) {
continue;
}
if (task_dir != NULL) {
while ((ent = readdir (task_dir)) != NULL) {
pid_t tid;
- if (get_pid (ent->d_name, &tid) == 0) {
+ if (get_pid(ent->d_name, &tid) == -1) {
continue;
}
if (tid == pid) {