diff options
Diffstat (limited to 'src/libtrace/libtrace.c')
-rw-r--r-- | src/libtrace/libtrace.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libtrace/libtrace.c b/src/libtrace/libtrace.c index f8cdd6b7b..3798cb998 100644 --- a/src/libtrace/libtrace.c +++ b/src/libtrace/libtrace.c | |||
@@ -77,7 +77,14 @@ void init(void) { | |||
77 | } | 77 | } |
78 | 78 | ||
79 | // logfile | 79 | // logfile |
80 | ftty = orig_fopen(logfile, "a"); | 80 | unsigned cnt = 0; |
81 | while ((ftty = orig_fopen(logfile, "a")) == NULL) { | ||
82 | if (++cnt > 10) { // 10 sec | ||
83 | perror("Cannot open trace log file"); | ||
84 | exit(1); | ||
85 | } | ||
86 | sleep(1); | ||
87 | } | ||
81 | 88 | ||
82 | // pid | 89 | // pid |
83 | mypid = getpid(); | 90 | mypid = getpid(); |