]> git.armaanb.net Git - opendoas.git/commitdiff
timestamp.c: already return on 22th field of /proc/ppid/stat
authorDuncan Overbruck <mail@duncano.de>
Fri, 6 Dec 2019 01:45:22 +0000 (02:45 +0100)
committerDuncan Overbruck <mail@duncano.de>
Mon, 3 Feb 2020 21:41:30 +0000 (22:41 +0100)
this is the last field we are interested in and if we didn't reach it,
return an error.

timestamp.c

index e97c92f6ea23af4ec2835dfc66a3b2d056c3bfd0..c90318dd71daf7ca6cc109ff2cad725949164ef4 100644 (file)
@@ -141,13 +141,11 @@ proc_info(pid_t pid, int *ttynr, unsigned long long *starttime)
                        if (p == ep ||
                           (errno == ERANGE && *starttime == ULLONG_MAX))
                                return -1;
-                       break;
+                       return 0;
                }
-               if (n == 23)
-                       break;
        }
 
-       return 0;
+       return -1;
 }
 #else
 #error "proc_info not implemented"