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>
|
2010-11-03 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
* Fixed bug in configure.ac
|
* Fixed bug in configure.ac
|
||||||
2010-10-27 P. A. Bagyenda <bagyenda@dsmagic.com>
|
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__)
|
#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 */
|
/* Stop all from using gwlib info, error and warning functions */
|
||||||
#define error use_mms_error_instead
|
#define error use_mms_error_instead
|
||||||
|
|
|
@ -536,9 +536,10 @@ static int send2email(Octstr *to, Octstr *from, Octstr *subject,
|
||||||
{
|
{
|
||||||
Octstr *s;
|
Octstr *s;
|
||||||
FILE *f;
|
FILE *f;
|
||||||
int ret = MMS_SEND_OK, i, n;
|
int ret = MMS_SEND_OK, i, n, fd = -1;
|
||||||
char fname[L_tmpnam];
|
char fname[] = "/tmp/mms.XXXXXX";
|
||||||
|
|
||||||
|
|
||||||
Octstr *cmd = octstr_create("");
|
Octstr *cmd = octstr_create("");
|
||||||
List *headers = mime_entity_headers(m); /* we don't want the mime version header removed. */
|
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;
|
i += 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tmpnam(fname) == NULL) {
|
if ((fd = mkstemp(fname)) < 0) {
|
||||||
*error = octstr_format("tmpnam: Failed to create temporary file: %s",
|
*error = octstr_format("mkstemp: Failed to create temporary file: %s",
|
||||||
strerror(errno));
|
strerror(errno));
|
||||||
ret = MMS_SEND_ERROR_TRANSIENT;
|
ret = MMS_SEND_ERROR_TRANSIENT;
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -712,8 +713,10 @@ static int send2email(Octstr *to, Octstr *from, Octstr *subject,
|
||||||
ret = MMS_SEND_QUEUED;
|
ret = MMS_SEND_QUEUED;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (fname[0])
|
if (fd >= 0) {
|
||||||
|
close(fd);
|
||||||
unlink(fname);
|
unlink(fname);
|
||||||
|
}
|
||||||
http_destroy_headers(headers);
|
http_destroy_headers(headers);
|
||||||
octstr_destroy(cmd);
|
octstr_destroy(cmd);
|
||||||
octstr_destroy(s);
|
octstr_destroy(s);
|
||||||
|
|
Loading…
Reference in New Issue