-/* $Cambridge: exim/src/src/receive.c,v 1.19 2005/06/22 15:44:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/receive.c,v 1.22 2005/08/01 14:41:25 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Now close the file if it is open, either as a fd or a stream. */
-if (data_file != NULL) fclose(data_file);
- else if (data_fd >= 0) close(data_fd);
+if (data_file != NULL) (void)fclose(data_file);
+ else if (data_fd >= 0) (void)close(data_fd);
/* Attempt to close down an SMTP connection tidily. */
error_rc = EXIT_FAILURE;
}
else fprintf(stderr, "exim: %s%s\n", text2, text1); /* Sic */
-fclose(f);
+(void)fclose(f);
exim_exit(error_rc);
}
MIME_ACL_CHECK:
mime_part_count = -1;
rc = mime_acl_check(acl, mbox_file, NULL, &user_msg, &log_msg);
-fclose(mbox_file);
+(void)fclose(mbox_file);
if (Ustrlen(rfc822_file_path) > 0) {
mime_part_count = mime_part_count_buffer;
struct dirent *entry;
DIR *tempdir;
- snprintf(CS temp_path, 1024, "%s/scan/%s", spool_directory, message_id);
+ (void)string_format(temp_path, 1024, "%s/scan/%s", spool_directory,
+ message_id);
tempdir = opendir(CS temp_path);
n = 0;
entry = readdir(tempdir);
if (entry == NULL) break;
if (strncmpic(US entry->d_name,US"__rfc822_",9) == 0) {
- snprintf(CS rfc822_file_path, 2048,"%s/scan/%s/%s", spool_directory, message_id, entry->d_name);
+ (void)string_format(rfc822_file_path, 2048,"%s/scan/%s/%s", spool_directory, message_id, entry->d_name);
debug_printf("RFC822 attachment detected: running MIME ACL for '%s'\n", rfc822_file_path);
break;
};
closedir(tempdir);
if (entry != NULL) {
- mbox_file = Ufopen(rfc822_file_path,"r");
+ mbox_file = Ufopen(rfc822_file_path,"rb");
if (mbox_file == NULL) {
log_write(0, LOG_PANIC,
"acl_smtp_mime: can't open RFC822 spool file, skipping.");
{
uschar *s = next->text;
int len = next->slen;
- fwrite(s, 1, len, data_file);
+ (void)fwrite(s, 1, len, data_file);
body_linecount++; /* Assumes only 1 line */
}
if (recipients_count == 0 || error_handling == ERRORS_STDERR)
{
Uunlink(spool_name);
- fclose(data_file);
+ (void)fclose(data_file);
exim_exit(error_rc);
}
}
{
log_write(0, LOG_MAIN|LOG_PANIC, "Couldn't fdopen message log %s: %s",
spool_name, strerror(errno));
- close(fd);
+ (void)close(fd);
}
else
{
frozen_by);
if (queue_only_policy) fprintf(message_log,
"%s no immediate delivery: queued by %s\n", now, queued_by);
- fclose(message_log);
+ (void)fclose(message_log);
}
}
}
if this happens? */
TIDYUP:
-process_info[process_info_len] = 0; /* Remove message id */
-if (data_file != NULL) fclose(data_file); /* Frees the lock */
+process_info[process_info_len] = 0; /* Remove message id */
+if (data_file != NULL) (void)fclose(data_file); /* Frees the lock */
/* Now reset signal handlers to their defaults */