ast_log(LOG_DEBUG, "Attaching file '%s', format '%s', uservm is '%d', global is %d\n", attach, format, attach_user_voicemail, ast_test_flag((&globalflags), VM_ATTACH));
/* Make a temporary file instead of piping directly to sendmail, in case the mail
command hangs */
- p = vm_mkftemp(tmp);
- if (p == NULL) {
- ast_log(LOG_WARNING, "Unable to launch '%s'\n", mailcmd);
+ if ((p = vm_mkftemp(tmp)) == NULL) {
+ ast_log(LOG_WARNING, "Unable to launch '%s' (can't create temporary file)\n", mailcmd);
return -1;
} else {
gethostname(host, sizeof(host)-1);
char tmp[80] = "/tmp/astmail-XXXXXX";
char tmp2[256];
struct tm tm;
- FILE *p = vm_mkftemp(tmp);
+ FILE *p;
- if (p == NULL) {
- ast_log(LOG_WARNING, "Unable to launch '%s'\n", mailcmd);
+ if ((p = vm_mkftemp(tmp)) == NULL) {
+ ast_log(LOG_WARNING, "Unable to launch '%s' (can't create temporary file)\n", mailcmd);
return -1;
} else {
gethostname(host, sizeof(host)-1);