summaryrefslogtreecommitdiff
path: root/os/backtrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/backtrace.c')
-rw-r--r--os/backtrace.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/os/backtrace.c b/os/backtrace.c
index 3100d1a13..fcc8274e4 100644
--- a/os/backtrace.c
+++ b/os/backtrace.c
@@ -267,7 +267,7 @@ xorg_backtrace_exec_wrapper(const char *path)
close(pipefd[1]);
snprintf(parent, sizeof(parent), "%d", getppid());
- execle(path, path, parent, NULL, NULL);
+ execl(path, path, parent, NULL);
exit(1);
}
else {
@@ -280,7 +280,21 @@ xorg_backtrace_exec_wrapper(const char *path)
close(pipefd[1]);
while (!done) {
- bytesread = read(pipefd[0], btline, sizeof(btline) - 1);
+ bytesread = 0;
+
+ do
+ {
+ int n = read(pipefd[0], &btline[bytesread], 1);
+
+ if (n <= 0)
+ break;
+
+ bytesread = bytesread + n;
+
+ if (btline[bytesread-1] == '\n')
+ break;
+ }
+ while (bytesread < sizeof(btline));
if (bytesread > 0) {
btline[bytesread] = 0;