1
0
Fork 0

minor compile error fixes

This commit is contained in:
bagyenda 2010-11-04 06:26:31 +00:00
parent 821f4f32bf
commit ea9506fde2
3 changed files with 11 additions and 6 deletions

View File

@ -1,3 +1,5 @@
2010-11-04 P. A. Bagyenda <bagyenda@dsmagic.com>
* Minor compiler error fixes
2010-11-03 P. A. Bagyenda <bagyenda@dsmagic.com>
* Fixed bug in configure.ac
2010-10-27 P. A. Bagyenda <bagyenda@dsmagic.com>

View File

@ -49,7 +49,7 @@ extern void mms_event_logger(enum mbuni_event_type_t type, const char *subtype,
#define mms_warning_ex(subtype,err,intf,id,fmt,...) mms_event_logger(MBUNI_WARNING, (subtype), (err), __FILE__, __LINE__,__FUNCTION__,(intf), (id),(fmt),##__VA_ARGS__)
MmsEventLoggerFuncs shell_event_logger; /* For logging using a shell command. */
extern MmsEventLoggerFuncs shell_event_logger; /* For logging using a shell command. */
/* Stop all from using gwlib info, error and warning functions */
#define error use_mms_error_instead

View File

@ -536,9 +536,10 @@ static int send2email(Octstr *to, Octstr *from, Octstr *subject,
{
Octstr *s;
FILE *f;
int ret = MMS_SEND_OK, i, n;
char fname[L_tmpnam];
int ret = MMS_SEND_OK, i, n, fd = -1;
char fname[] = "/tmp/mms.XXXXXX";
Octstr *cmd = octstr_create("");
List *headers = mime_entity_headers(m); /* we don't want the mime version header removed. */
@ -677,8 +678,8 @@ static int send2email(Octstr *to, Octstr *from, Octstr *subject,
i += 2;
}
if (tmpnam(fname) == NULL) {
*error = octstr_format("tmpnam: Failed to create temporary file: %s",
if ((fd = mkstemp(fname)) < 0) {
*error = octstr_format("mkstemp: Failed to create temporary file: %s",
strerror(errno));
ret = MMS_SEND_ERROR_TRANSIENT;
goto done;
@ -712,8 +713,10 @@ static int send2email(Octstr *to, Octstr *from, Octstr *subject,
ret = MMS_SEND_QUEUED;
done:
if (fname[0])
if (fd >= 0) {
close(fd);
unlink(fname);
}
http_destroy_headers(headers);
octstr_destroy(cmd);
octstr_destroy(s);