diff options
author | Christophe Grenier <[email protected]> | 2012-12-23 17:13:50 +0100 |
---|---|---|
committer | Christophe Grenier <[email protected]> | 2012-12-23 17:13:50 +0100 |
commit | 775ed679d3be5ab80d9283c5b9ce35155393b8e5 (patch) | |
tree | 81ff82208e3fc726a5216c146edb433765e45642 /src/testdisk.c | |
parent | b4a555b8a56d97b633623241199b23f9816e54fa (diff) |
move testdisk.log file creation a little bit earlier
Diffstat (limited to 'src/testdisk.c')
-rw-r--r-- | src/testdisk.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/testdisk.c b/src/testdisk.c index 636d20bc..209fc39f 100644 --- a/src/testdisk.c +++ b/src/testdisk.c @@ -141,12 +141,16 @@ int main( int argc, char **argv ) { if(create_log==TD_LOG_NONE) create_log=TD_LOG_APPEND; + if(log_handle==NULL) + log_handle=log_open(logfile, create_log); } else if((strcmp(argv[i],"/debug")==0) || (strcmp(argv[i],"-debug")==0)) { verbose++; if(create_log==TD_LOG_NONE) create_log=TD_LOG_APPEND; + if(log_handle==NULL) + log_handle=log_open(logfile, create_log); } else if((strcmp(argv[i],"/all")==0) || (strcmp(argv[i],"-all")==0)) testdisk_mode|=TESTDISK_O_ALL; @@ -304,8 +308,6 @@ int main( int argc, char **argv ) delete_list_disk(list_disk); return 0; } - if(create_log!=TD_LOG_NONE) - log_handle=log_open(logfile, create_log); #ifdef HAVE_SETLOCALE if(run_setlocale>0) { |