1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

support: Make support_process_state_wait return the found state

So caller can check which state was found if multiple ones are
asked.

Checked on x86_64-linux-gnu.

Reviewed-by: Florian Weimer <fweimer@redhat.com>
This commit is contained in:
Adhemerval Zanella
2024-09-13 11:10:05 -03:00
parent 25efda03df
commit 38316352e0
3 changed files with 24 additions and 8 deletions

View File

@@ -27,7 +27,7 @@
#include <support/xstdio.h>
#include <support/check.h>
void
enum support_process_state
support_process_state_wait (pid_t pid, enum support_process_state state)
{
#ifdef __linux__
@@ -75,7 +75,7 @@ support_process_state_wait (pid_t pid, enum support_process_state state)
{
free (line);
xfclose (fstatus);
return;
return process_states[i].s;
}
rewind (fstatus);
@@ -90,4 +90,6 @@ support_process_state_wait (pid_t pid, enum support_process_state state)
/* Fallback to nanosleep if an invalid state is found. */
#endif
nanosleep (&(struct timespec) { 1, 0 }, NULL);
return support_process_state_invalid;
}