rval = SWITCH_FALSE;
}
- if (unlink(filename) != 0) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", filename);
- }
-
if (zstr(err)) {
if (file) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Emailed file [%s] to [%s]\n", filename, to);
if (fd > -1) {
close(fd);
}
+
+ if (unlink(filename) != 0) {
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Failed to delete file [%s]\n", filename);
+ }
+
if (ifd > -1) {
close(ifd);
}