Lines 84-90
Link Here
|
84 |
pid = fork(); |
84 |
pid = fork(); |
85 |
if (pid == -1) { |
85 |
if (pid == -1) { |
86 |
perror("fork"); |
86 |
perror("fork"); |
87 |
@@ -312,7 +339,7 @@ is_debugger_attached(void) |
87 |
@@ -312,14 +339,13 @@ is_debugger_attached(void) |
88 |
_exit(1); |
88 |
_exit(1); |
89 |
if (!waitpid(-1, NULL, 0)) |
89 |
if (!waitpid(-1, NULL, 0)) |
90 |
_exit(1); |
90 |
_exit(1); |
Lines 93-99
Link Here
|
93 |
ptrace(PTRACE_DETACH, ppid, NULL, NULL); |
93 |
ptrace(PTRACE_DETACH, ppid, NULL, NULL); |
94 |
_exit(0); |
94 |
_exit(0); |
95 |
} else { |
95 |
} else { |
96 |
@@ -346,17 +373,19 @@ int main(int argc, char *argv[]) |
96 |
close(pipefd[0]); |
|
|
97 |
|
98 |
/* Enable child to ptrace the parent process */ |
99 |
- rc = prctl(PR_SET_PTRACER, pid); |
100 |
if (rc != 0 && errno != EINVAL) { |
101 |
/* An error prevents us from telling if a debugger is attached. |
102 |
* Instead of propagating the error, assume no debugger present. |
103 |
@@ -346,17 +372,19 @@ int main(int argc, char *argv[]) |
97 |
const struct test *t; |
104 |
const struct test *t; |
98 |
pid_t pid; |
105 |
pid_t pid; |
99 |
int total, pass; |
106 |
int total, pass; |
Lines 116-122
Link Here
|
116 |
if (is_debugger_attached()) { |
123 |
if (is_debugger_attached()) { |
117 |
leak_check_enabled = 0; |
124 |
leak_check_enabled = 0; |
118 |
timeouts_enabled = 0; |
125 |
timeouts_enabled = 0; |
119 |
@@ -364,7 +393,17 @@ int main(int argc, char *argv[]) |
126 |
@@ -364,7 +392,17 @@ int main(int argc, char *argv[]) |
120 |
leak_check_enabled = !getenv("WAYLAND_TEST_NO_LEAK_CHECK"); |
127 |
leak_check_enabled = !getenv("WAYLAND_TEST_NO_LEAK_CHECK"); |
121 |
timeouts_enabled = !getenv("WAYLAND_TEST_NO_TIMEOUTS"); |
128 |
timeouts_enabled = !getenv("WAYLAND_TEST_NO_TIMEOUTS"); |
122 |
} |
129 |
} |
Lines 134-140
Link Here
|
134 |
if (argc == 2 && strcmp(argv[1], "--help") == 0) |
141 |
if (argc == 2 && strcmp(argv[1], "--help") == 0) |
135 |
usage(argv[0], EXIT_SUCCESS); |
142 |
usage(argv[0], EXIT_SUCCESS); |
136 |
|
143 |
|
137 |
@@ -395,7 +434,8 @@ int main(int argc, char *argv[]) |
144 |
@@ -395,7 +433,8 @@ int main(int argc, char *argv[]) |
138 |
if (pid == 0) |
145 |
if (pid == 0) |
139 |
run_test(t); /* never returns */ |
146 |
run_test(t); /* never returns */ |
140 |
|
147 |
|
Lines 144-150
Link Here
|
144 |
stderr_set_color(RED); |
151 |
stderr_set_color(RED); |
145 |
fprintf(stderr, "waitid failed: %m\n"); |
152 |
fprintf(stderr, "waitid failed: %m\n"); |
146 |
stderr_reset_color(); |
153 |
stderr_reset_color(); |
147 |
@@ -426,6 +466,25 @@ int main(int argc, char *argv[]) |
154 |
@@ -426,6 +465,25 @@ int main(int argc, char *argv[]) |
148 |
|
155 |
|
149 |
break; |
156 |
break; |
150 |
} |
157 |
} |