summaryrefslogtreecommitdiffstats
path: root/libdwfl/linux-pid-attach.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdwfl/linux-pid-attach.c')
-rw-r--r--libdwfl/linux-pid-attach.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libdwfl/linux-pid-attach.c b/libdwfl/linux-pid-attach.c
index fdf5c9b1..cd534825 100644
--- a/libdwfl/linux-pid-attach.c
+++ b/libdwfl/linux-pid-attach.c
@@ -30,6 +30,8 @@
30# include <config.h> 30# include <config.h>
31#endif 31#endif
32 32
33#include <system.h>
34
33#include "libelfP.h" 35#include "libelfP.h"
34#include "libdwflP.h" 36#include "libdwflP.h"
35#include <sys/types.h> 37#include <sys/types.h>
@@ -59,7 +61,7 @@ linux_proc_pid_is_stopped (pid_t pid)
59 61
60 have_state = false; 62 have_state = false;
61 while (fgets (buffer, sizeof (buffer), procfile) != NULL) 63 while (fgets (buffer, sizeof (buffer), procfile) != NULL)
62 if (strncmp (buffer, "State:", 6) == 0) 64 if (startswith (buffer, "State:"))
63 { 65 {
64 have_state = true; 66 have_state = true;
65 break; 67 break;
@@ -407,7 +409,7 @@ dwfl_linux_proc_attach (Dwfl *dwfl, pid_t pid, bool assume_ptrace_stopped)
407 char *line = NULL; 409 char *line = NULL;
408 size_t linelen = 0; 410 size_t linelen = 0;
409 while (getline (&line, &linelen, procfile) >= 0) 411 while (getline (&line, &linelen, procfile) >= 0)
410 if (strncmp (line, "Tgid:", 5) == 0) 412 if (startswith (line, "Tgid:"))
411 { 413 {
412 errno = 0; 414 errno = 0;
413 char *endptr; 415 char *endptr;