]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
switch_core_file: Fix a regression from earlier commit on some distro forcing warning...
authorMarc Olivier Chouinard <mochouinard@moctel.com>
Mon, 25 Apr 2011 02:47:12 +0000 (22:47 -0400)
committerMarc Olivier Chouinard <mochouinard@moctel.com>
Mon, 25 Apr 2011 02:47:12 +0000 (22:47 -0400)
src/switch_core_file.c

index 2186555386d05944b342b187f9a30301ef6e63aa..a3f7cc12cced4bf77deb040886e894d7b4d4d3b0 100644 (file)
@@ -571,8 +571,11 @@ SWITCH_DECLARE(switch_status_t) switch_core_file_close(switch_file_handle_t *fh)
 #else
                command = switch_mprintf("/bin/mv %s %s", fh->spool_path, fh->file_path);
 #endif
-               system(command);
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Copy spooled file [%s] to [%s]\n", fh->spool_path, fh->file_path);
+               if (system(command) == -1) {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Failed to copy spooled file [%s] to [%s] because of a command error : %s\n", fh->spool_path, fh->file_path, command);
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Copy spooled file [%s] to [%s]\n", fh->spool_path, fh->file_path);
+               }
                free(command);
        }