parse-util: introduce pid_is_valid()
Checking for validity of a PID is relatively easy, but let's add a helper cal for this too, in order to make things more readable and more similar to uid_is_valid(), gid_is_valid() and friends.
This commit is contained in:
@@ -118,6 +118,10 @@ static inline bool ioprio_priority_is_valid(int i) {
|
||||
return i >= 0 && i < IOPRIO_BE_NR;
|
||||
}
|
||||
|
||||
static inline bool pid_is_valid(pid_t p) {
|
||||
return p > 0;
|
||||
}
|
||||
|
||||
int ioprio_parse_priority(const char *s, int *ret);
|
||||
|
||||
pid_t getpid_cached(void);
|
||||
|
||||
Reference in New Issue
Block a user