minor compile error fixes
This commit is contained in:
parent
821f4f32bf
commit
ea9506fde2
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -536,8 +536,9 @@ 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);
|
||||
|
|
Loading…
Reference in New Issue