[core] fix cannot open error in switch_simple_email()

This commit is contained in:
agree 2022-01-07 01:41:47 -05:00
parent f9bb8940c2
commit 5e3b08d95f
1 changed files with 5 additions and 1 deletions

View File

@ -1170,7 +1170,7 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
if (file) {
if ((ifd = open(file, O_RDONLY | O_BINARY)) < 0) {
rval = SWITCH_FALSE;
err = "Cannot open tmp file\n";
err = "Cannot open file\n";
goto end;
}
}
@ -1288,6 +1288,10 @@ SWITCH_DECLARE(switch_bool_t) switch_simple_email(const char *to,
goto end;
}
}
} else {
err = "cannot open tmp file\n";
rval = SWITCH_FALSE;
goto end;
}
if (fd > -1) {