switch_core_file: Fix a regression from earlier commit on some distro forcing warning on 'forced' return function value

This commit is contained in:
Marc Olivier Chouinard 2011-04-24 22:47:12 -04:00
parent adffe07f75
commit 68c9381770
1 changed files with 5 additions and 2 deletions

View 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);
}