diff --git a/uftrace.c b/uftrace.c index 536d33b2f..099e8bbef 100644 --- a/uftrace.c +++ b/uftrace.c @@ -1082,8 +1082,10 @@ int main(int argc, char *argv[]) if (opts.logfile) { logfp = fopen(opts.logfile, "a"); - if (logfp == NULL) + if (logfp == NULL) { + logfp = stderr; pr_err("cannot open log file"); + } setvbuf(logfp, NULL, _IOLBF, 1024); }