pidref: several follow-ups for pidref_wait_for_terminate_full()

Follow-up for e74b571004

* Do not reuse si
* Refuse timeout == 0
* Use usec_add()
* Rename ret to ret_si - unlike others this one is not so obvious
This commit is contained in:
Mike Yuan
2025-12-20 21:41:01 +01:00
parent 72ce1046e8
commit f3c6660b9c
6 changed files with 21 additions and 22 deletions
+3 -3
View File
@@ -96,9 +96,9 @@ int pidref_kill(const PidRef *pidref, int sig);
int pidref_kill_and_sigcont(const PidRef *pidref, int sig);
int pidref_sigqueue(const PidRef *pidref, int sig, int value);
int pidref_wait_for_terminate_full(PidRef *pidref, usec_t timeout, siginfo_t *ret);
static inline int pidref_wait_for_terminate(PidRef *pidref, siginfo_t *ret) {
return pidref_wait_for_terminate_full(pidref, USEC_INFINITY, ret);
int pidref_wait_for_terminate_full(PidRef *pidref, usec_t timeout, siginfo_t *ret_si);
static inline int pidref_wait_for_terminate(PidRef *pidref, siginfo_t *ret_si) {
return pidref_wait_for_terminate_full(pidref, USEC_INFINITY, ret_si);
}
static inline void pidref_done_sigterm_wait(PidRef *pidref) {