qphotorec: redirect stderr to the log file only if it exists
This commit is contained in:
parent
79bf6ce3e1
commit
ff449ff6f2
1 changed files with 4 additions and 1 deletions
|
@ -52,7 +52,10 @@ int main(int argc, char *argv[])
|
|||
FILE *log_handle;
|
||||
log_handle=log_open("qphotorec.log", TD_LOG_CREATE, &log_errno);
|
||||
#ifdef HAVE_DUP2
|
||||
dup2(fileno(log_handle),2);
|
||||
if(log_handle)
|
||||
{
|
||||
dup2(fileno(log_handle),2);
|
||||
}
|
||||
#endif
|
||||
my_time=time(NULL);
|
||||
log_info("\n\n%s",ctime(&my_time));
|
||||
|
|
Loading…
Reference in a new issue