-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.173 2005/06/27 10:52:20 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.174 2005/06/27 14:29:43 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
db.h files).
PH/26 Insert a lot of missing (void) casts for functions such as chown(),
- chmod(), fcntl(), and sscanf(). These were picked up on a user's system
- that detects such things. There doesn't seem to be a gcc warning option
- for this - only an attribute that has to be put on the function's
- prototype. I'm sure I haven't caught all of these, but it's a start.
+ chmod(), fcntl(), sscanf(), and other functions from stdio.h. These were
+ picked up on a user's system that detects such things. There doesn't seem
+ to be a gcc warning option for this - only an attribute that has to be
+ put on the function's prototype. It seems that in Fedora Core 4 they have
+ set this on a number of new functions. No doubt there will be more in due
+ course.
PH/27 If a dnslookup or manualroute router is set with verify=only, it need not
specify a transport. However, if an address that was verified by such a
-/* $Cambridge: exim/src/src/acl.c,v 1.40 2005/06/20 13:58:22 ph10 Exp $ */
+/* $Cambridge: exim/src/src/acl.c,v 1.41 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
return ERROR;
}
acl_text[statbuf.st_size] = 0;
- close(fd);
+ (void)close(fd);
acl_name = string_sprintf("ACL \"%s\"", ss);
HDEBUG(D_acl) debug_printf("read ACL from file %s\n", ss);
-/* $Cambridge: exim/src/src/auths/pwcheck.c,v 1.1 2004/10/07 13:10:01 ph10 Exp $ */
+/* $Cambridge: exim/src/src/auths/pwcheck.c,v 1.2 2005/06/27 14:29:44 ph10 Exp $ */
/* SASL server API implementation
* Rob Siemborski
start += n;
}
- close(s);
+ (void)close(s);
if (start > 1 && !strncmp(response, "OK", 2)) {
return PWCHECK_OK;
if ( write_string(s, userid, Ustrlen(userid)) < 0) {
DEBUG(D_auth)
debug_printf("Failed to send userid to saslauthd daemon \n");
- close(s);
+ (void)close(s);
return PWCHECK_FAIL;
}
if ( write_string(s, password, Ustrlen(password)) < 0) {
DEBUG(D_auth)
debug_printf("Failed to send password to saslauthd daemon \n");
- close(s);
+ (void)close(s);
return PWCHECK_FAIL;
}
if ( write_string(s, service, Ustrlen(service)) < 0) {
DEBUG(D_auth)
debug_printf("Failed to send service name to saslauthd daemon \n");
- close(s);
+ (void)close(s);
return PWCHECK_FAIL;
}
if ( write_string(s, realm, Ustrlen(realm)) < 0) {
DEBUG(D_auth)
debug_printf("Failed to send realm to saslauthd daemon \n");
- close(s);
+ (void)close(s);
return PWCHECK_FAIL;
}
if ( read_string(s, &daemon_reply ) < 2) {
DEBUG(D_auth)
debug_printf("Corrupted answer '%s' received. \n", daemon_reply);
- close(s);
+ (void)close(s);
return PWCHECK_FAIL;
}
- close(s);
+ (void)close(s);
DEBUG(D_auth)
debug_printf("Answer '%s' received. \n", daemon_reply);
-/* $Cambridge: exim/src/src/buildconfig.c,v 1.9 2005/06/17 13:52:15 ph10 Exp $ */
+/* $Cambridge: exim/src/src/buildconfig.c,v 1.10 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (base == NULL)
{
printf("*** Buildconfig: failed to open Makefile\n");
- fclose(new);
+ (void)fclose(new);
exit(1);
}
}
fprintf(new, "\n");
-fclose(base);
+(void)fclose(base);
/* Now handle the macros listed in the defaults */
if (base == NULL)
{
printf("*** Buildconfig: failed to open ../src/config.h.defaults\n");
- fclose(new);
+ (void)fclose(new);
exit(1);
}
}
}
-fclose(base);
+(void)fclose(base);
/* If any AUTH macros were defined, ensure that SUPPORT_CRYPTEQ is also
defined. */
/* End off */
fprintf(new, "\n/* End of config.h */\n");
-fclose(new);
+(void)fclose(new);
return 0;
}
-/* $Cambridge: exim/src/src/child.c,v 1.4 2005/02/17 11:58:25 ph10 Exp $ */
+/* $Cambridge: exim/src/src/child.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
force_fd(int oldfd, int newfd)
{
if (oldfd == newfd) return;
-close(newfd);
-dup2(oldfd, newfd);
-close(oldfd);
+(void)close(newfd);
+(void)dup2(oldfd, newfd);
+(void)close(oldfd);
}
if (pid == 0)
{
force_fd(pfd[pipe_read], 0);
- close(pfd[pipe_write]);
+ (void)close(pfd[pipe_write]);
if (debug_fd > 0) force_fd(debug_fd, 2);
if (bounce_sender_authentication != NULL)
child_exec_exim(CEE_EXEC_EXIT, FALSE, NULL, FALSE, 8,
pipe. */
save_errno = errno;
-close(pfd[pipe_read]);
+(void)close(pfd[pipe_read]);
/* Fork succeeded */
/* Fork failed */
-close(pfd[pipe_write]);
+(void)close(pfd[pipe_write]);
errno = save_errno;
return (pid_t)(-1);
}
if (pipe(inpfd) != 0) return (pid_t)(-1);
if (pipe(outpfd) != 0)
{
- close(inpfd[pipe_read]);
- close(inpfd[pipe_write]);
+ (void)close(inpfd[pipe_read]);
+ (void)close(inpfd[pipe_write]);
return (pid_t)(-1);
}
{
if (make_leader && setpgid(0,0) < 0) goto CHILD_FAILED;
- close(inpfd[pipe_write]);
+ (void)close(inpfd[pipe_write]);
force_fd(inpfd[pipe_read], 0);
- close(outpfd[pipe_read]);
+ (void)close(outpfd[pipe_read]);
force_fd(outpfd[pipe_write], 1);
- close(2);
- dup2(1, 2);
+ (void)close(2);
+ (void)dup2(1, 2);
/* Set the required environment. */
stdin pipe, and the writing end of the stdout pipe. */
save_errno = errno;
-close(inpfd[pipe_read]);
-close(outpfd[pipe_write]);
+(void)close(inpfd[pipe_read]);
+(void)close(outpfd[pipe_write]);
/* Fork succeeded; return the input/output pipes and the pid */
/* Fork failed; reset fork errno before returning */
-close(inpfd[pipe_write]);
-close(outpfd[pipe_read]);
+(void)close(inpfd[pipe_write]);
+(void)close(outpfd[pipe_read]);
errno = save_errno;
return (pid_t)(-1);
}
-/* $Cambridge: exim/src/src/daemon.c,v 1.12 2005/06/22 15:44:37 ph10 Exp $ */
+/* $Cambridge: exim/src/src/daemon.c,v 1.13 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
extensive comment before the reception loop in exim.c for a fuller
explanation of this logic. */
- for (i = 0; i < listen_socket_count; i++) close(listen_sockets[i]);
+ for (i = 0; i < listen_socket_count; i++) (void)close(listen_sockets[i]);
#ifdef SA_NOCLDWAIT
act.sa_handler = SIG_IGN;
if ((dpid = fork()) == 0)
{
- fclose(smtp_in);
- fclose(smtp_out);
+ (void)fclose(smtp_in);
+ (void)fclose(smtp_out);
/* Don't ever molest the parent's SSL connection, but do clean up
the data structures if necessary. */
strerror(errno));
smtp_out = NULL;
}
-else close(accept_socket);
+else (void)close(accept_socket);
if (smtp_in != NULL)
{
strerror(errno));
smtp_in = NULL;
}
-else close(dup_accept_socket);
+else (void)close(dup_accept_socket);
/* Release any store used in this process, including the store used for holding
the incoming host address and an expanded active_hostname. */
{
log_close_all(); /* Just in case anything was logged earlier */
search_tidyup(); /* Just in case any were used in reading the config. */
- close(0); /* Get rid of stdin/stdout/stderr */
- close(1);
- close(2);
+ (void)close(0); /* Get rid of stdin/stdout/stderr */
+ (void)close(1);
+ (void)close(2);
exim_nullstd(); /* Connect stdin/stdout/stderr to /dev/null */
log_stderr = NULL; /* So no attempt to copy paniclog output */
{
DEBUG(D_any) debug_printf("wildcard IPv4 bind() failed after IPv6 "
"listen() success; EADDRINUSE ignored\n");
- close(listen_sockets[sk]);
+ (void)close(listen_sockets[sk]);
goto SKIP_SOCKET;
}
msg = US strerror(errno);
DEBUG(D_any) debug_printf("wildcard IPv4 listen() failed after IPv6 "
"listen() success; EADDRINUSE ignored\n");
- close(listen_sockets[sk]);
+ (void)close(listen_sockets[sk]);
/* Come here if there has been a problem with the socket which we
are going to ignore. We remove the address from the chain, and back up the
/* Close any open listening sockets in the child */
- for (sk = 0; sk < listen_socket_count; sk++) close(listen_sockets[sk]);
+ for (sk = 0; sk < listen_socket_count; sk++)
+ (void)close(listen_sockets[sk]);
/* Reset SIGHUP and SIGCHLD in the child in both cases. */
int sk;
log_write(0, LOG_MAIN, "pid %d: SIGHUP received: re-exec daemon",
getpid());
- for (sk = 0; sk < listen_socket_count; sk++) close(listen_sockets[sk]);
+ for (sk = 0; sk < listen_socket_count; sk++)
+ (void)close(listen_sockets[sk]);
alarm(0);
signal(SIGHUP, SIG_IGN);
sighup_argv[0] = exim_path;
-/* $Cambridge: exim/src/src/dbfn.c,v 1.5 2005/06/22 15:44:37 ph10 Exp $ */
+/* $Cambridge: exim/src/src/dbfn.c,v 1.6 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
log_write(0, LOG_MAIN, "Failed to get %s lock for %s: %s",
((flags & O_RDONLY) != 0)? "read" : "write", buffer,
(errno == ETIMEDOUT)? "timed out" : strerror(errno));
- close(dbblock->lockfd);
+ (void)close(dbblock->lockfd);
errno = 0; /* Indicates locking failure */
return NULL;
}
debug_printf("%s", CS string_open_failed(save_errno, "DB file %s\n",
buffer));
}
- close(dbblock->lockfd);
+ (void)close(dbblock->lockfd);
errno = save_errno;
return NULL;
}
dbfn_close(open_db *dbblock)
{
EXIM_DBCLOSE(dbblock->dbptr);
-close(dbblock->lockfd);
+(void)close(dbblock->lockfd);
}
-/* $Cambridge: exim/src/src/deliver.c,v 1.19 2005/06/22 15:44:37 ph10 Exp $ */
+/* $Cambridge: exim/src/src/deliver.c,v 1.20 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
log_write(0, LOG_MAIN, "<%s>: %s transport output: %s",
addr->address, tb->name, s);
}
- fclose(f);
+ (void)fclose(f);
}
}
addr->return_file = -1;
}
- close(addr->return_file);
+ (void)close(addr->return_file);
}
/* Create the address string for logging. Must not do this earlier, because
half - for transports that exec things (e.g. pipe). Then set the required
gid/uid. */
- close(pfd[pipe_read]);
+ (void)close(pfd[pipe_read]);
(void)fcntl(pfd[pipe_write], F_SETFD, fcntl(pfd[pipe_write], F_GETFD) |
FD_CLOEXEC);
exim_setugid(uid, gid, use_initgroups,
int local_part_length = Ustrlen(addr2->local_part);
uschar *s;
- write(pfd[pipe_write], (void *)&(addr2->transport_return), sizeof(int));
- write(pfd[pipe_write], (void *)&transport_count, sizeof(transport_count));
- write(pfd[pipe_write], (void *)&(addr2->flags), sizeof(addr2->flags));
- write(pfd[pipe_write], (void *)&(addr2->basic_errno), sizeof(int));
- write(pfd[pipe_write], (void *)&(addr2->more_errno), sizeof(int));
- write(pfd[pipe_write], (void *)&(addr2->special_action), sizeof(int));
- write(pfd[pipe_write], (void *)&(addr2->transport),
+ (void)write(pfd[pipe_write], (void *)&(addr2->transport_return), sizeof(int));
+ (void)write(pfd[pipe_write], (void *)&transport_count, sizeof(transport_count));
+ (void)write(pfd[pipe_write], (void *)&(addr2->flags), sizeof(addr2->flags));
+ (void)write(pfd[pipe_write], (void *)&(addr2->basic_errno), sizeof(int));
+ (void)write(pfd[pipe_write], (void *)&(addr2->more_errno), sizeof(int));
+ (void)write(pfd[pipe_write], (void *)&(addr2->special_action), sizeof(int));
+ (void)write(pfd[pipe_write], (void *)&(addr2->transport),
sizeof(transport_instance *));
/* For a file delivery, pass back the local part, in case the original
if (testflag(addr2, af_file))
{
- write(pfd[pipe_write], (void *)&local_part_length, sizeof(int));
- write(pfd[pipe_write], addr2->local_part, local_part_length);
+ (void)write(pfd[pipe_write], (void *)&local_part_length, sizeof(int));
+ (void)write(pfd[pipe_write], addr2->local_part, local_part_length);
}
/* Now any messages */
for (i = 0, s = addr2->message; i < 2; i++, s = addr2->user_message)
{
int message_length = (s == NULL)? 0 : Ustrlen(s) + 1;
- write(pfd[pipe_write], (void *)&message_length, sizeof(int));
- if (message_length > 0) write(pfd[pipe_write], s, message_length);
+ (void)write(pfd[pipe_write], (void *)&message_length, sizeof(int));
+ if (message_length > 0) (void)write(pfd[pipe_write], s, message_length);
}
}
/* OK, this process is now done. Free any cached resources that it opened,
and close the pipe we were writing down before exiting. */
- close(pfd[pipe_write]);
+ (void)close(pfd[pipe_write]);
search_tidyup();
exit(EXIT_SUCCESS);
}
overwriting the address structure. If data is missing, the default DEFER status
will remain. Afterwards, close the reading end. */
-close(pfd[pipe_write]);
+(void)close(pfd[pipe_write]);
for (addr2 = addr; addr2 != NULL; addr2 = addr2->next)
{
}
}
-close(pfd[pipe_read]);
+(void)close(pfd[pipe_read]);
/* Unless shadowing, write all successful addresses immediately to the journal
file, to ensure they are recorded asap. For homonymic addresses, use the base
/* Close and wait for child process to complete, without a timeout. */
- fclose(f);
+ (void)fclose(f);
(void)child_close(pid, 0);
}
}
/* Close our end of the pipe, to prevent deadlock if the far end is still
pushing stuff into it. */
-close(fd);
+(void)close(fd);
p->fd = -1;
/* If we have finished without error, but haven't had data for every address,
if (poffset >= remote_max_parallel)
{
- close(pfd[pipe_write]);
- close(pfd[pipe_read]);
+ (void)close(pfd[pipe_write]);
+ (void)close(pfd[pipe_read]);
remote_post_process(addr, LOG_MAIN|LOG_PANIC,
US"Unexpectedly no free subprocess slot", fallback);
continue;
that are running in parallel. */
for (poffset = 0; poffset < remote_max_parallel; poffset++)
- if (parlist[poffset].pid != 0) close(parlist[poffset].fd);
+ if (parlist[poffset].pid != 0) (void)close(parlist[poffset].fd);
/* This process has inherited a copy of the file descriptor
for the data file, but its file pointer is shared with all the
the parent process. There doesn't seem to be any way of doing
a dup-with-new-file-pointer. */
- close(deliver_datafile);
+ (void)close(deliver_datafile);
sprintf(CS spoolname, "%s/input/%s/%s-D", spool_directory, message_subdir,
message_id);
deliver_datafile = Uopen(spoolname, O_RDWR | O_APPEND, 0);
and run the transport. Afterwards, transport_count will contain the number
of bytes written. */
- close(pfd[pipe_read]);
+ (void)close(pfd[pipe_read]);
set_process_info("delivering %s using %s", message_id, tp->name);
debug_print_string(tp->debug_string);
if (!(tp->info->code)(addr->transport, addr)) replicate_status(addr);
{
if (h->address == NULL || h->status < hstatus_unusable) continue;
sprintf(CS big_buffer, "H%c%c%s", h->status, h->why, h->address);
- write(fd, big_buffer, Ustrlen(big_buffer+3) + 4);
+ (void)write(fd, big_buffer, Ustrlen(big_buffer+3) + 4);
}
/* The number of bytes written. This is the same for each address. Even
big_buffer[0] = 'S';
memcpy(big_buffer+1, &transport_count, sizeof(transport_count));
- write(fd, big_buffer, sizeof(transport_count) + 1);
+ (void)write(fd, big_buffer, sizeof(transport_count) + 1);
/* Information about what happened to each address. Three item types are
used: an optional 'X' item first, for TLS information, followed by 'R'
sprintf(CS ptr, "%.512s", addr->peerdn);
while(*ptr++);
}
- write(fd, big_buffer, ptr - big_buffer);
+ (void)write(fd, big_buffer, ptr - big_buffer);
}
#endif
sprintf(CS ptr, "%.512s", r->message);
while(*ptr++);
}
- write(fd, big_buffer, ptr - big_buffer);
+ (void)write(fd, big_buffer, ptr - big_buffer);
}
/* The rest of the information goes in an 'A' item. */
memcpy(ptr, &(addr->host_used->port), sizeof(addr->host_used->port));
ptr += sizeof(addr->host_used->port);
}
- write(fd, big_buffer, ptr - big_buffer);
+ (void)write(fd, big_buffer, ptr - big_buffer);
}
/* Add termination flag, close the pipe, and that's it. The character
big_buffer[0] = 'Z';
big_buffer[1] = (continue_transport == NULL)? '0' : '1';
- write(fd, big_buffer, 2);
- close(fd);
+ (void)write(fd, big_buffer, 2);
+ (void)close(fd);
exit(EXIT_SUCCESS);
}
/* Back in the mainline: close the unwanted half of the pipe. */
- close(pfd[pipe_write]);
+ (void)close(pfd[pipe_write]);
/* Fork failed; defer with error message */
if (pid < 0)
{
- close(pfd[pipe_read]);
+ (void)close(pfd[pipe_read]);
remote_post_process(addr, LOG_MAIN|LOG_PANIC,
string_sprintf("fork failed for remote delivery to %s: %s",
addr->domain, strerror(errno)), fallback);
readconf_printtime(keep_malformed));
}
- close(deliver_datafile);
+ (void)close(deliver_datafile);
deliver_datafile = -1;
return continue_closedown(); /* yields DELIVER_NOT_ATTEMPTED */
}
DEBUG(D_deliver) debug_printf("Previously delivered address %s taken from "
"journal file\n", big_buffer);
}
- fclose(jread);
+ (void)fclose(jread);
/* Panic-dies on error */
(void)spool_write_header(message_id, SW_DELIVERING, NULL);
}
if (recipients_list == NULL)
{
- close(deliver_datafile);
+ (void)close(deliver_datafile);
deliver_datafile = -1;
log_write(0, LOG_MAIN, "Spool error: no recipients for %s", spoolname);
return continue_closedown(); /* yields DELIVER_NOT_ATTEMPTED */
continue_hostname != NULL
))
{
- close(deliver_datafile);
+ (void)close(deliver_datafile);
deliver_datafile = -1;
log_write(L_skip_delivery, LOG_MAIN, "Message is frozen");
return continue_closedown(); /* yields DELIVER_NOT_ATTEMPTED */
if (rc == FF_ERROR || rc == FF_NONEXIST)
{
- close(deliver_datafile);
+ (void)close(deliver_datafile);
deliver_datafile = -1;
log_write(0, LOG_MAIN|LOG_PANIC, "Error in system filter: %s",
string_printing(filter_message));
else
{
while ((ch = fgetc(fm)) != EOF) fputc(ch, f);
- fclose(fm);
+ (void)fclose(fm);
}
Uunlink(addr->return_filename);
{
emf_text = next_emf(emf, US"final");
if (emf_text != NULL) fprintf(f, "%s", CS emf_text);
- fclose(emf);
+ (void)fclose(emf);
}
/* Close the file, which should send an EOF to the child process
that is receiving the message. Wait for it to finish. */
- fclose(f);
+ (void)fclose(f);
rc = child_close(pid, 0); /* Waits for child to close, no timeout */
/* In the test harness, let the child do it's thing first. */
{
wmf_text = next_emf(wmf, US"final");
if (wmf_text != NULL) fprintf(f, "%s", CS wmf_text);
- fclose(wmf);
+ (void)fclose(wmf);
}
else
{
/* Close and wait for child process to complete, without a timeout.
If there's an error, don't update the count. */
- fclose(f);
+ (void)fclose(f);
if (child_close(pid, 0) == 0)
{
warning_count = count;
/* Finished with the message log. If the message is complete, it will have
been unlinked or renamed above. */
-if (message_logs) fclose(message_log);
+if (message_logs) (void)fclose(message_log);
/* Now we can close and remove the journal file. Its only purpose is to record
successfully completed deliveries asap so that this information doesn't get
message off the main spool if frozen and the option is set. It should get moved
at the next attempt, after the journal has been inspected. */
-if (journal_fd >= 0) close(journal_fd);
+if (journal_fd >= 0) (void)close(journal_fd);
if (remove_journal)
{
will go away. Otherwise the message becomes available for another process
to try delivery. */
-close(deliver_datafile);
+(void)close(deliver_datafile);
deliver_datafile = -1;
DEBUG(D_deliver) debug_printf("end delivery of %s\n", id);
-/* $Cambridge: exim/src/src/demime.c,v 1.5 2005/05/24 08:15:02 tom Exp $ */
+/* $Cambridge: exim/src/src/demime.c,v 1.6 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (!demime_ok)
demime_rc = mime_demux(mbox_file, defer_error_buffer);
- fclose(mbox_file);
+ (void)fclose(mbox_file);
if (demime_rc == DEFER) {
/* temporary failure (DEFER => DEFER) */
c = fgetc(f);
if (c == EOF) break;
if ( (c == '\t') || (c == ' ') ) continue;
- ungetc(c,f);
+ (void)ungetc(c,f);
};
/* end of the header, terminate with ';' */
c = ';';
if (data_len == -2) {
/* temp error, turn off uudecode mode */
if (uu_dump_file != NULL) {
- fclose(uu_dump_file); uu_dump_file = NULL;
+ (void)fclose(uu_dump_file); uu_dump_file = NULL;
};
uu_mode = MIME_UU_MODE_OFF;
return DEFER;
}
else if (data_len == -1) {
if (uu_dump_file != NULL) {
- fclose(uu_dump_file); uu_dump_file = NULL;
+ (void)fclose(uu_dump_file); uu_dump_file = NULL;
};
uu_mode = MIME_UU_MODE_OFF;
data_len = 0;
check for single "end" tag on line */
if ((strncmpic(line,US"end",3) == 0) && (line[3] < 32)) {
if (uu_dump_file != NULL) {
- fclose(uu_dump_file); uu_dump_file = NULL;
+ (void)fclose(uu_dump_file); uu_dump_file = NULL;
};
uu_mode = MIME_UU_MODE_OFF;
}
if (data_len == -2) {
/* temp error, turn off uudecode mode */
if (uu_dump_file != NULL) {
- fclose(uu_dump_file); uu_dump_file = NULL;
+ (void)fclose(uu_dump_file); uu_dump_file = NULL;
};
uu_mode = MIME_UU_MODE_OFF;
return DEFER;
mime_demux(mime_dump_file,info);
};
- fclose(mime_dump_file); mime_dump_file = NULL;
+ (void)fclose(mime_dump_file); mime_dump_file = NULL;
};
}
else if (tmp == 2) {
mime_demux(mime_dump_file,info);
};
- fclose(mime_dump_file); mime_dump_file = NULL;
+ (void)fclose(mime_dump_file); mime_dump_file = NULL;
};
}
else {
/* close files, they could still be open */
if (mime_dump_file != NULL)
- fclose(mime_dump_file);
+ (void)fclose(mime_dump_file);
if (uu_dump_file != NULL)
- fclose(uu_dump_file);
+ (void)fclose(uu_dump_file);
/* release line buffer */
free(line);
-/* $Cambridge: exim/src/src/dk.c,v 1.4 2005/06/24 08:23:21 tom Exp $ */
+/* $Cambridge: exim/src/src/dk.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Looks like a filename, load the private key. */
memset(big_buffer,0,big_buffer_size);
privkey_fd = open(CS dk_private_key,O_RDONLY);
- read(privkey_fd,big_buffer,16383);
- close(privkey_fd);
+ (void)read(privkey_fd,big_buffer,16383);
+ (void)close(privkey_fd);
dk_private_key = big_buffer;
}
-/* $Cambridge: exim/src/src/exim_dbmbuild.c,v 1.3 2005/06/14 10:32:01 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim_dbmbuild.c,v 1.4 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
{
printf("exim_dbmbuild: unable to create %s: %s\n", temp_dbmname,
strerror(errno));
- fclose(f);
+ (void)fclose(f);
exit(1);
}
TIDYUP:
EXIM_DBCLOSE(d);
-fclose(f);
+(void)fclose(f);
/* If successful, output the number of entries and rename the temporary
files. */
-/* $Cambridge: exim/src/src/exim_dbutil.c,v 1.6 2005/06/22 15:44:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim_dbutil.c,v 1.7 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
printf("** Failed to get %s lock for %s: %s",
((flags & O_RDONLY) != 0)? "read" : "write", buffer,
(errno == ETIMEDOUT)? "timed out" : strerror(errno));
- close(dbblock->lockfd);
+ (void)close(dbblock->lockfd);
return NULL;
}
""
#endif
);
- close(dbblock->lockfd);
+ (void)close(dbblock->lockfd);
return NULL;
}
dbfn_close(open_db *dbblock)
{
EXIM_DBCLOSE(dbblock->dbptr);
-close(dbblock->lockfd);
+(void)close(dbblock->lockfd);
}
-/* $Cambridge: exim/src/src/exim_lock.c,v 1.2 2005/06/22 15:44:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim_lock.c,v 1.3 2005/06/27 14:29:43 ph10 Exp $ */
/* A program to lock a file exactly as Exim would, for investigation of
interlocking problems.
/* Apply hitching post algorithm. */
if ((rc = link(hitchname, lockname)) != 0) fstat(hd, &statbuf);
- close(hd);
+ (void)close(hd);
unlink(hitchname);
if (rc != 0 && statbuf.st_nlink != 2)
-/* $Cambridge: exim/src/src/expand.c,v 1.35 2005/06/22 15:44:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.36 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
}
yield = cat_file(f, yield, &size, &ptr, sub_arg[1]);
- fclose(f);
+ (void)fclose(f);
continue;
}
alarm(timeout);
yield = cat_file(f, yield, &size, &ptr, sub_arg[3]);
alarm(0);
- fclose(f);
+ (void)fclose(f);
/* After a timeout, we restore the pointer in the result, that is,
make sure we add nothing from the socket. */
/* Nothing is written to the standard input. */
- close(fd_in);
+ (void)close(fd_in);
/* Wait for the process to finish, applying the timeout, and inspect its
return code for serious disasters. Simple non-zero returns are passed on.
f = fdopen(fd_out, "rb");
lookup_value = NULL;
lookup_value = cat_file(f, lookup_value, &lsize, &lptr, NULL);
- fclose(f);
+ (void)fclose(f);
}
/* Process the yes/no strings; $value may be useful in both cases */
-/* $Cambridge: exim/src/src/filter.c,v 1.3 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/filter.c,v 1.4 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (log_mode == -1) log_mode = 0600;
if (log_fd >= 0)
{
- close(log_fd);
+ (void)close(log_fd);
log_fd = -1;
}
log_filename = expargs[0];
/* Close the log file if it was opened, and kill off any numerical variables
before returning. Reset the header decoding charset. */
-if (log_fd >= 0) close(log_fd);
+if (log_fd >= 0) (void)close(log_fd);
expand_nmax = -1;
filter_running = FALSE;
headers_charset = save_headers_charset;
-/* $Cambridge: exim/src/src/filtertest.c,v 1.5 2005/04/06 14:40:24 ph10 Exp $ */
+/* $Cambridge: exim/src/src/filtertest.c,v 1.6 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
filebuf = store_get(statbuf.st_size + 1);
rc = read(fd, filebuf, statbuf.st_size);
-close(fd);
+(void)close(fd);
if (rc != statbuf.st_size)
{
-/* $Cambridge: exim/src/src/ip.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/ip.c,v 1.3 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* A failure whose error code is "Interrupted system call" is in fact
an externally applied timeout if the signal handler has been run. */
-close(sock);
+(void)close(sock);
errno = (save_errno == EINTR && sigalrm_seen)? ETIMEDOUT : save_errno;
return -1;
}
-/* $Cambridge: exim/src/src/log.c,v 1.4 2005/06/22 15:44:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/log.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
uschar *nowstamp = tod_stamp(tod_log_datestamp);
if (Ustrncmp (mainlog_datestamp, nowstamp, Ustrlen(nowstamp)) != 0)
{
- close(mainlogfd); /* Close the file */
+ (void)close(mainlogfd); /* Close the file */
mainlogfd = -1; /* Clear the file descriptor */
mainlog_inode = 0; /* Unset the inode */
mainlog_datestamp = NULL; /* Clear the datestamp */
{
if (Ustat(mainlog_name, &statbuf) < 0 || statbuf.st_ino != mainlog_inode)
{
- close(mainlogfd);
+ (void)close(mainlogfd);
mainlogfd = -1;
mainlog_inode = 0;
}
uschar *nowstamp = tod_stamp(tod_log_datestamp);
if (Ustrncmp (rejectlog_datestamp, nowstamp, Ustrlen(nowstamp)) != 0)
{
- close(rejectlogfd); /* Close the file */
+ (void)close(rejectlogfd); /* Close the file */
rejectlogfd = -1; /* Clear the file descriptor */
rejectlog_inode = 0; /* Unset the inode */
rejectlog_datestamp = NULL; /* Clear the datestamp */
if (Ustat(rejectlog_name, &statbuf) < 0 ||
statbuf.st_ino != rejectlog_inode)
{
- close(rejectlogfd);
+ (void)close(rejectlogfd);
rejectlogfd = -1;
rejectlog_inode = 0;
}
flags |= LOG_PANIC_DIE;
}
- close(paniclogfd);
+ (void)close(paniclogfd);
}
/* Give up if the DIE flag is set */
log_close_all(void)
{
if (mainlogfd >= 0)
- { close(mainlogfd); mainlogfd = -1; }
+ { (void)close(mainlogfd); mainlogfd = -1; }
if (rejectlogfd >= 0)
- { close(rejectlogfd); rejectlogfd = -1; }
+ { (void)close(rejectlogfd); rejectlogfd = -1; }
closelog();
syslog_open = FALSE;
}
-/* $Cambridge: exim/src/src/lookups/cdb.c,v 1.2 2005/06/07 15:20:56 ph10 Exp $ */
+/* $Cambridge: exim/src/src/lookups/cdb.c,v 1.3 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
}
#endif /* HAVE_MMAP */
- close(cdbp->fileno);
+ (void)close(cdbp->fileno);
}
/* End of lookups/cdb.c */
-/* $Cambridge: exim/src/src/lookups/dbmdb.c,v 1.2 2005/01/04 10:00:44 ph10 Exp $ */
+/* $Cambridge: exim/src/src/lookups/dbmdb.c,v 1.3 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
#else
{
uschar filebuffer[256];
- sprintf(CS filebuffer, "%.250s.db", filename);
+ (void)sprintf(CS filebuffer, "%.250s.db", filename);
rc = lf_check_file(-1, filebuffer, S_IFREG, modemask, owners, owngroups,
"dbm", errmsg);
if (rc < 0) /* stat() failed */
{
- sprintf(CS filebuffer, "%.250s.dir", filename);
+ (void)sprintf(CS filebuffer, "%.250s.dir", filename);
rc = lf_check_file(-1, filebuffer, S_IFREG, modemask, owners, owngroups,
"dbm", errmsg);
if (rc == 0) /* x.dir was OK */
{
- sprintf(CS filebuffer, "%.250s.pag", filename);
+ (void)sprintf(CS filebuffer, "%.250s.pag", filename);
rc = lf_check_file(-1, filebuffer, S_IFREG, modemask, owners, owngroups,
"dbm", errmsg);
}
-/* $Cambridge: exim/src/src/lookups/lsearch.c,v 1.3 2005/01/11 15:51:03 ph10 Exp $ */
+/* $Cambridge: exim/src/src/lookups/lsearch.c,v 1.4 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
void
lsearch_close(void *handle)
{
-fclose((FILE *)handle);
+(void)fclose((FILE *)handle);
}
/* End of lookups/lsearch.c */
-/* $Cambridge: exim/src/src/malware.c,v 1.9 2005/06/06 18:49:35 tom Exp $ */
+/* $Cambridge: exim/src/src/malware.c,v 1.10 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
};
/* none of our current scanners need the mbox
file as a stream, so we can close it right away */
- fclose(mbox_file);
+ (void)fclose(mbox_file);
/* extract the malware regex to match against from the option list */
if ((malware_regex = string_nextinlist(&list, &sep,
}
if (ip_connect(sock, AF_INET, (uschar*)inet_ntoa(in), port, 5) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: connection to %s, port %u failed (%s)",
inet_ntoa(in), port, strerror(errno));
/* calc file size */
drweb_fd = open(CS scanrequest, O_RDONLY);
if (drweb_fd == -1) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: can't open spool file %s: %s",
scanrequest, strerror(errno));
}
fsize = lseek(drweb_fd, 0, SEEK_END);
if (fsize == -1) {
- close(sock);
- close(drweb_fd);
+ (void)close(sock);
+ (void)close(drweb_fd);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: can't seek spool file %s: %s",
scanrequest, strerror(errno));
(send(sock, &drweb_flags, sizeof(drweb_flags), 0) < 0) ||
(send(sock, &drweb_fin, sizeof(drweb_fin), 0) < 0) ||
(send(sock, &drweb_slen, sizeof(drweb_slen), 0) < 0)) {
- close(sock);
- close(drweb_fd);
+ (void)close(sock);
+ (void)close(drweb_fd);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: unable to send commands to socket (%s)", drweb_options);
return DEFER;
drweb_fbuf = (uschar *) malloc (fsize);
if (!drweb_fbuf) {
- close(sock);
- close(drweb_fd);
+ (void)close(sock);
+ (void)close(drweb_fd);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: unable to allocate memory %u for file (%s)",
fsize, scanrequest);
result = read (drweb_fd, drweb_fbuf, fsize);
if (result == -1) {
- close(sock);
- close(drweb_fd);
+ (void)close(sock);
+ (void)close(drweb_fd);
free(drweb_fbuf);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: can't read spool file %s: %s",
scanrequest, strerror(errno));
return DEFER;
}
- close(drweb_fd);
+ (void)close(drweb_fd);
/* send file body to socket */
if (send(sock, drweb_fbuf, fsize, 0) < 0) {
- close(sock);
+ (void)close(sock);
free(drweb_fbuf);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: unable to send file body to socket (%s)", drweb_options);
return DEFER;
}
- close(drweb_fd);
+ (void)close(drweb_fd);
}
else {
/* open the drwebd UNIX socket */
server.sun_family = AF_UNIX;
Ustrcpy(server.sun_path, drweb_options);
if (connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: unable to connect to socket (%s). errno=%d", drweb_options, errno);
return DEFER;
(send(sock, &drweb_slen, sizeof(drweb_slen), 0) < 0) ||
(send(sock, scanrequest, Ustrlen(scanrequest), 0) < 0) ||
(send(sock, &drweb_fin, sizeof(drweb_fin), 0) < 0)) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: unable to send commands to socket (%s)", drweb_options);
return DEFER;
/* wait for result */
if ((bread = recv(sock, &drweb_rc, sizeof(drweb_rc), 0) != sizeof(drweb_rc))) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: unable to read return code");
return DEFER;
drweb_rc = ntohl(drweb_rc);
if ((bread = recv(sock, &drweb_vnum, sizeof(drweb_vnum), 0) != sizeof(drweb_vnum))) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: unable to read the number of viruses");
return DEFER;
{
/* read the size of report */
if ((bread = recv(sock, &drweb_slen, sizeof(drweb_slen), 0) != sizeof(drweb_slen))) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: cannot read report size");
return DEFER;
/* read report body */
if ((bread = recv(sock, tmpbuf, drweb_slen, 0)) != drweb_slen) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: cannot read report string");
return DEFER;
if (drweb_s) {
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: drweb: drweb daemon retcode 0x%x (%s)", drweb_rc, drweb_s);
- close(sock);
+ (void)close(sock);
return DEFER;
}
/* no virus found */
malware_name = NULL;
};
- close(sock);
+ (void)close(sock);
}
/* ----------------------------------------------------------------------- */
else if (strcmpic(scanner_name,US"aveserver") == 0) {
server.sun_family = AF_UNIX;
Ustrcpy(server.sun_path, kav_options);
if (connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to connect to aveserver UNIX socket (%s). errno=%d", kav_options, errno);
return DEFER;
if (buf[0] != '2') {
/* aveserver is having problems */
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: aveserver is unavailable (Responded: %s).", ((buf[0] != 0) ? buf : (uschar *)"nothing") );
return DEFER;
/* and send it */
if (send(sock, buf, Ustrlen(buf), 0) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to write to aveserver UNIX socket (%s)", kav_options);
return DEFER;
/* and send it */
if (send(sock, buf, Ustrlen(buf), 0) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to write to aveserver UNIX socket (%s)", kav_options);
return DEFER;
if (buf[0] != '2') {
/* aveserver is having problems */
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to quit aveserver dialogue (Responded: %s).", ((buf[0] != 0) ? buf : (uschar *)"nothing") );
return DEFER;
};
- close(sock);
+ (void)close(sock);
if (result == DEFER) return DEFER;
}
server.sun_family = AF_UNIX;
Ustrcpy(server.sun_path, fsecure_options);
if (connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to connect to fsecure socket %s (%s)",
fsecure_options, strerror(errno));
for (i=0; i != 4; i++) {
/* debug_printf("send option \"%s\"",cmdoptions[i]); */
if (write(sock, cmdoptions[i], Ustrlen(cmdoptions[i])) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to write fsecure option %d to %s (%s)",
i, fsecure_options, strerror(errno));
bread = read(sock, av_buffer, sizeof(av_buffer));
if (bread >0) av_buffer[bread]='\0';
if (bread < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to read fsecure answer %d (%s)", i, strerror(errno));
return DEFER;
snprintf(CS file_name,1024,"SCAN\t%s/scan/%s/%s.eml\n", spool_directory, message_id, message_id);
/* debug_printf("send scan %s",file_name); */
if (write(sock, file_name, Ustrlen(file_name)) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to write fsecure scan to %s (%s)",
fsecure_options, strerror(errno));
do {
bread=read(sock, &av_buffer[i], 1);
if (bread < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to read fsecure result (%s)", strerror(errno));
return DEFER;
};
}
while (Ustrstr(av_buffer, "OK\tScan ok.") == NULL);
- close(sock);
+ (void)close(sock);
}
/* ----------------------------------------------------------------------- */
server.sun_family = AF_UNIX;
Ustrcpy(server.sun_path, kav_options);
if (connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to connect to kavdaemon UNIX socket (%s). errno=%d", kav_options, errno);
return DEFER;
/* send scan request */
if (send(sock, scanrequest, Ustrlen(scanrequest)+1, 0) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to write to kavdaemon UNIX socket (%s)", kav_options);
return DEFER;
/* wait for result */
if ((bread = recv(sock, tmpbuf, 2, 0) != 2)) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to read 2 bytes from kavdaemon socket.");
return DEFER;
/* improper kavdaemon configuration */
if ( (kav_rc == 5) || (kav_rc == 6) ) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: please reconfigure kavdaemon to NOT disinfect or remove infected files.");
return DEFER;
};
if (kav_rc == 1) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: kavdaemon reported 'scanning not completed' (code 1).");
return DEFER;
};
if (kav_rc == 7) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: kavdaemon reported 'kavdaemon damaged' (code 7).");
return DEFER;
if( report_flag == 1 ) {
/* read report size */
if ((bread = recv(sock, &kav_reportlen, 4, 0)) != 4) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: cannot read report size from kavdaemon");
return DEFER;
malware_name = NULL;
};
- close(sock);
+ (void)close(sock);
}
/* ----------------------------------------------------------------------- */
trigger = 1;
};
- fclose(scanner_record);
+ (void)fclose(scanner_record);
pclose(scanner_out);
signal(SIGCHLD,eximsigchld);
signal(SIGPIPE,eximsigpipe);
pcre_copy_substring(CS linebuffer, ovector, result, 1, CS malware_name_buffer, 255);
};
};
- fclose(scanner_record);
+ (void)fclose(scanner_record);
}
else {
/* no virus found */
server.sun_family = AF_UNIX;
Ustrcpy(server.sun_path, sophie_options);
if (connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to connect to sophie UNIX socket (%s). errno=%d", sophie_options, errno);
return DEFER;
/* pass the scan directory to sophie */
snprintf(CS file_name,1024,"%s/scan/%s", spool_directory, message_id);
if (write(sock, file_name, Ustrlen(file_name)) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to write to sophie UNIX socket (%s)", sophie_options);
return DEFER;
};
- write(sock, "\n", 1);
+ (void)write(sock, "\n", 1);
/* wait for result */
memset(av_buffer, 0, sizeof(av_buffer));
if ((!(bread = read(sock, av_buffer, sizeof(av_buffer))) > 0)) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to read from sophie UNIX socket (%s)", sophie_options);
return DEFER;
};
- close(sock);
+ (void)close(sock);
/* infected ? */
if (av_buffer[0] == '1') {
}
if (ip_connect(sock, AF_INET, (uschar*)inet_ntoa(in), port, 5) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: clamd: connection to %s, port %u failed (%s)",
inet_ntoa(in), port, strerror(errno));
snprintf(CS file_name,1024,"SCAN %s/scan/%s\n", spool_directory, message_id);
if (send(sock, file_name, Ustrlen(file_name), 0) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,"malware acl condition: clamd: unable to write to socket (%s)",
strerror(errno));
return DEFER;
/* Pass the string to ClamAV (7 = "STREAM\n") */
if (send(sock, "STREAM\n", 7, 0) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,"malware acl condition: clamd: unable to write to socket (%s)",
strerror(errno));
return DEFER;
}
if (ip_connect(sockData, AF_INET, (uschar*)inet_ntoa(in), port, 5) < 0) {
- close(sockData);
+ (void)close(sockData);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: clamd: connection to %s, port %u failed (%s)",
inet_ntoa(in), port, strerror(errno));
clamav_fbuf = (uschar *) malloc (fsize);
if (!clamav_fbuf) {
- close(sockData);
- close(clam_fd);
+ (void)close(sockData);
+ (void)close(clam_fd);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: clamd: unable to allocate memory %u for file (%s)",
fsize, scanrequest);
result = read (clam_fd, clamav_fbuf, fsize);
if (result == -1) {
- close(sockData);
- close(clam_fd);
+ (void)close(sockData);
+ (void)close(clam_fd);
free(clamav_fbuf);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: clamd: can't read spool file %s: %s",
scanrequest, strerror(errno));
return DEFER;
}
- close(clam_fd);
+ (void)close(clam_fd);
/* send file body to socket */
if (send(sockData, clamav_fbuf, fsize, 0) < 0) {
- close(sockData);
+ (void)close(sockData);
free(clamav_fbuf);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: clamd: unable to send file body to socket (%s:%u)", hostname, port);
return DEFER;
}
free(clamav_fbuf);
- close(sockData);
+ (void)close(sockData);
}
}
else {
Ustrcpy(server.sun_path, clamd_options);
if (connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: clamd: unable to connect to UNIX socket %s (%s)",
clamd_options, strerror(errno) );
snprintf(CS file_name,1024,"SCAN %s/scan/%s\n", spool_directory, message_id);
if (send(sock, file_name, Ustrlen(file_name), 0) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,"malware acl condition: clamd: unable to write to socket (%s)",
strerror(errno));
return DEFER;
/* Read the result */
memset(av_buffer, 0, sizeof(av_buffer));
bread = read(sock, av_buffer, sizeof(av_buffer));
- close(sock);
+ (void)close(sock);
if (!(bread > 0)) {
log_write(0, LOG_MAIN|LOG_PANIC,
server.sun_family = AF_UNIX;
Ustrcpy(server.sun_path, "/var/run/mksd/socket");
if (connect(sock, (struct sockaddr *) &server, sizeof(struct sockaddr_un)) < 0) {
- close(sock);
+ (void)close(sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: unable to connect to mksd UNIX socket (/var/run/mksd/socket). errno=%d", errno);
return DEFER;
-/* $Cambridge: exim/src/src/match.c,v 1.6 2005/06/22 10:17:23 ph10 Exp $ */
+/* $Cambridge: exim/src/src/match.c,v 1.7 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
switch ((func)(arg, ss, valueptr, &error))
{
case OK:
- fclose(f);
+ (void)fclose(f);
HDEBUG(D_lists) debug_printf("%s %s (matched \"%s\" in %s)\n", ot,
(yield == OK)? "yes" : "no", sss, filename);
return file_yield;
case DEFER:
- fclose(f);
+ (void)fclose(f);
goto DEFER_RETURN;
case ERROR: /* host name lookup failed - this can only */
{
HDEBUG(D_lists) debug_printf("%s %s (%s)\n", ot,
include_unknown? "yes":"no", error);
- fclose(f);
+ (void)fclose(f);
if (!include_unknown) return FAIL;
log_write(0, LOG_MAIN, "%s: accepted by +include_unknown", error);
return OK;
for the file, in case this is the last item in the list. */
yield = file_yield;
- fclose(f);
+ (void)fclose(f);
}
} /* Loop for the next item on the top-level list */
-/* $Cambridge: exim/src/src/mime.c,v 1.7 2005/04/04 10:33:49 ph10 Exp $ */
+/* $Cambridge: exim/src/src/mime.c,v 1.8 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
}
- fclose(decode_file);
+ (void)fclose(decode_file);
clearerr(mime_stream);
fseek(mime_stream,f_pos,SEEK_SET);
c = fgetc(f);
if (c == EOF) break;
if ( (c == '\t') || (c == ' ') ) continue;
- ungetc(c,f);
+ (void)ungetc(c,f);
};
/* end of the header, terminate with ';' */
c = ';';
-/* $Cambridge: exim/src/src/moan.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/moan.c,v 1.3 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Close the file, which should send an EOF to the child process
that is receiving the message. Wait for it to finish, without a timeout. */
-fclose(f);
+(void)fclose(f);
status = child_close(pid, 0); /* Waits for child to close */
if (status != 0)
{
}
}
-fclose(f);
+(void)fclose(f);
child_close(pid, 0); /* Waits for child to close; no timeout */
}
else
fprintf(f, "No valid addresses were generated.\n");
-fclose(f);
+(void)fclose(f);
child_close(pid, 0); /* Waits for child to close; no timeout */
return TRUE;
-/* $Cambridge: exim/src/src/os.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/os.c,v 1.3 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Close the socket, and return the chain of data blocks. */
-close(vs);
+(void)close(vs);
return yield;
}
-/* $Cambridge: exim/src/src/parse.c,v 1.4 2005/02/17 11:58:26 ph10 Exp $ */
+/* $Cambridge: exim/src/src/parse.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
{
*error = string_sprintf("failed to stat included file %s: %s",
filename, strerror(errno));
- fclose(f);
+ (void)fclose(f);
return FF_INCLUDEFAIL;
}
{
*error = string_sprintf("error while reading included file %s: %s",
filename, strerror(errno));
- fclose(f);
+ (void)fclose(f);
return FF_ERROR;
}
filebuf[statbuf.st_size] = 0;
- fclose(f);
+ (void)fclose(f);
addr = NULL;
frc = parse_forward_list(filebuf, options, &addr,
-/* $Cambridge: exim/src/src/queue.c,v 1.7 2005/06/16 14:10:13 ph10 Exp $ */
+/* $Cambridge: exim/src/src/queue.c,v 1.8 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (queue_run_pipe == 0)
{
queue_run_pipe = dup(queue_run_pipe);
- close(0);
+ (void)close(0);
}
/* Before forking to deliver the message, ensure any open and cached
/* Close the writing end of the synchronizing pipe in this process,
then wait for the first level process to terminate. */
- close(pfd[pipe_write]);
+ (void)close(pfd[pipe_write]);
set_process_info("running queue: waiting for %s (%d)", f->text, pid);
while (wait(&status) != pid);
big_buffer[n-1] = 0;
tree_add_nonrecipient(big_buffer);
}
- fclose(jread);
+ (void)fclose(jread);
}
}
}
while((rc = read(fd, big_buffer, big_buffer_size)) > 0)
- write(fileno(stdout), big_buffer, rc);
+ (void)write(fileno(stdout), big_buffer, rc);
- close(fd);
+ (void)close(fd);
return TRUE;
}
printf("Spool format error for %s\n", spoolname);
if (action != MSG_REMOVE || !admin_user)
{
- close(deliver_datafile);
+ (void)close(deliver_datafile);
deliver_datafile = -1;
return FALSE;
}
if (!admin_user && (action != MSG_REMOVE || real_uid != originator_uid))
{
printf("Permission denied\n");
- close(deliver_datafile);
+ (void)close(deliver_datafile);
deliver_datafile = -1;
return FALSE;
}
/* Closing the datafile releases the lock and permits other processes
to operate on the message (if it still exists). */
-close(deliver_datafile);
+(void)close(deliver_datafile);
deliver_datafile = -1;
return yield;
}
-/* $Cambridge: exim/src/src/rda.c,v 1.7 2005/06/16 14:10:13 ph10 Exp $ */
+/* $Cambridge: exim/src/src/rda.c,v 1.8 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
DEBUG(D_route)
debug_printf(OFF_T_FMT " bytes read from %s\n", statbuf.st_size, filename);
-fclose(fwd);
+(void)fclose(fwd);
return filebuf;
/* Return an error: the string is already set up. */
ERROR_RETURN:
*yield = FF_ERROR;
-fclose(fwd);
+(void)fclose(fwd);
return NULL;
}
rda_write_string(int fd, uschar *s)
{
int len = (s == NULL)? 0 : Ustrlen(s) + 1;
-write(fd, &len, sizeof(int));
-if (s != NULL) write(fd, s, len);
+(void)write(fd, &len, sizeof(int));
+if (s != NULL) (void)write(fd, s, len);
}
header_line *waslast = header_last; /* Save last header */
fd = pfd[pipe_write];
- close(pfd[pipe_read]);
+ (void)close(pfd[pipe_read]);
exim_setugid(ugid->uid, ugid->gid, FALSE, rname);
/* Addresses can get rewritten in filters; if we are not root or the exim
/* Pass back whether it was a filter, and the return code and any overall
error text via the pipe. */
- write(fd, filtertype, sizeof(int));
- write(fd, &yield, sizeof(int));
+ (void)write(fd, filtertype, sizeof(int));
+ (void)write(fd, &yield, sizeof(int));
rda_write_string(fd, *error);
/* Pass back the contents of any syntax error blocks if we have a pointer */
header_line *h;
for (h = header_list; h != waslast->next; i++, h = h->next)
{
- if (h->type == htype_old) write(fd, &i, sizeof(i));
+ if (h->type == htype_old) (void)write(fd, &i, sizeof(i));
}
i = -1;
- write(fd, &i, sizeof(i));
+ (void)write(fd, &i, sizeof(i));
while (waslast != header_last)
{
if (waslast->type != htype_old)
{
rda_write_string(fd, waslast->text);
- write(fd, &(waslast->type), sizeof(waslast->type));
+ (void)write(fd, &(waslast->type), sizeof(waslast->type));
}
}
rda_write_string(fd, NULL); /* Indicates end of added headers */
/* Write the contents of the $n variables */
- write(fd, filter_n, sizeof(filter_n));
+ (void)write(fd, filter_n, sizeof(filter_n));
/* If the result was DELIVERED or NOTDELIVERED, we pass back the generated
addresses, and their associated information, through the pipe. This is
int reply_options = 0;
rda_write_string(fd, addr->address);
- write(fd, &(addr->mode), sizeof(addr->mode));
- write(fd, &(addr->flags), sizeof(addr->flags));
+ (void)write(fd, &(addr->mode), sizeof(addr->mode));
+ (void)write(fd, &(addr->flags), sizeof(addr->flags));
rda_write_string(fd, addr->p.errors_address);
if (addr->pipe_expandn != NULL)
rda_write_string(fd, NULL);
if (addr->reply == NULL)
- write(fd, &reply_options, sizeof(int)); /* 0 means no reply */
+ (void)write(fd, &reply_options, sizeof(int)); /* 0 means no reply */
else
{
reply_options |= REPLY_EXISTS;
if (addr->reply->file_expand) reply_options |= REPLY_EXPAND;
if (addr->reply->return_message) reply_options |= REPLY_RETURN;
- write(fd, &reply_options, sizeof(int));
- write(fd, &(addr->reply->expand_forbid), sizeof(int));
- write(fd, &(addr->reply->once_repeat), sizeof(time_t));
+ (void)write(fd, &reply_options, sizeof(int));
+ (void)write(fd, &(addr->reply->expand_forbid), sizeof(int));
+ (void)write(fd, &(addr->reply->once_repeat), sizeof(time_t));
rda_write_string(fd, addr->reply->to);
rda_write_string(fd, addr->reply->cc);
rda_write_string(fd, addr->reply->bcc);
/* OK, this process is now done. Must use _exit() and not exit() !! */
- close(fd);
+ (void)close(fd);
_exit(0);
}
writing end must be closed first, as otherwise read() won't return zero on an
empty pipe. Afterwards, close the reading end. */
-close(pfd[pipe_write]);
+(void)close(pfd[pipe_write]);
/* Read initial data, including yield and contents of *error */
}
FINAL_EXIT:
-close(fd);
+(void)close(fd);
signal(SIGCHLD, oldsignal); /* restore */
return yield;
-/* $Cambridge: exim/src/src/readconf.c,v 1.10 2005/06/21 14:14:55 ph10 Exp $ */
+/* $Cambridge: exim/src/src/readconf.c,v 1.11 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
{
if (config_file_stack != NULL) /* EOF inside .include */
{
- fclose(config_file);
+ (void)fclose(config_file);
config_file = config_file_stack->file;
config_filename = config_file_stack->filename;
config_lineno = config_file_stack->lineno;
}
}
-fclose(config_file);
+(void)fclose(config_file);
}
/* End of readconf.c */
-/* $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.20 2005/06/27 14:29:43 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;
{
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 */
-/* $Cambridge: exim/src/src/regex.c,v 1.5 2005/05/24 08:15:02 tom Exp $ */
+/* $Cambridge: exim/src/src/regex.c,v 1.6 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
Ustrncpy(regex_match_string_buffer, re_list_item->pcre_text, 1023);
regex_match_string = regex_match_string_buffer;
if (mime_stream == NULL)
- fclose(mbox_file);
+ (void)fclose(mbox_file);
else {
clearerr(mime_stream);
fseek(mime_stream,f_pos,SEEK_SET);
};
if (mime_stream == NULL)
- fclose(mbox_file);
+ (void)fclose(mbox_file);
else {
clearerr(mime_stream);
fseek(mime_stream,f_pos,SEEK_SET);
mime_subject_len, 0, 0, NULL, 0) >= 0) {
Ustrncpy(regex_match_string_buffer, re_list_item->pcre_text, 1023);
regex_match_string = regex_match_string_buffer;
- fclose(f);
+ (void)fclose(f);
return OK;
};
re_list_item = re_list_item->next;
} while (re_list_item != NULL);
- fclose(f);
+ (void)fclose(f);
/* no matches ... */
return FAIL;
-/* $Cambridge: exim/src/src/routers/iplookup.c,v 1.2 2005/01/04 10:00:44 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/iplookup.c,v 1.3 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (send(query_socket, query, query_len, 0) < 0)
{
DEBUG(D_route) debug_printf("send to %s failed\n", h->address);
- close(query_socket);
+ (void)close(query_socket);
continue;
}
next IP address. */
count = ip_recv(query_socket, reply, sizeof(reply) - 1, ob->timeout);
- close(query_socket);
+ (void)close(query_socket);
if (count <= 0)
{
DEBUG(D_route) debug_printf("%s from %s\n", (errno == ETIMEDOUT)?
-/* $Cambridge: exim/src/src/routers/queryprogram.c,v 1.4 2005/04/28 13:06:32 ph10 Exp $ */
+/* $Cambridge: exim/src/src/routers/queryprogram.c,v 1.5 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Nothing is written to the standard input. */
-close(fd_in);
+(void)close(fd_in);
/* Wait for the process to finish, applying the timeout, and inspect its return
code. */
/* Read the pipe to get the command's output, and then close it. */
len = read(fd_out, buffer, sizeof(buffer) - 1);
-close(fd_out);
+(void)close(fd_out);
/* Failure to return any data is an error. */
-/* $Cambridge: exim/src/src/smtp_in.c,v 1.19 2005/05/23 16:58:56 fanf2 Exp $ */
+/* $Cambridge: exim/src/src/smtp_in.c,v 1.20 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (tls_active >= 0) (void)tls_write(s, ptr); else
#endif
- fwrite(s, 1, ptr, smtp_out);
+ (void)fwrite(s, 1, ptr, smtp_out);
DEBUG(D_receive) debug_printf("SMTP>> %s", s);
helo_seen = TRUE;
break; /* HELO/EHLO */
if ((pid = fork()) == 0)
{
- smtp_input = FALSE; /* This process is not associated with the */
- fclose(smtp_in); /* SMTP call any more. */
- fclose(smtp_out);
+ smtp_input = FALSE; /* This process is not associated with the */
+ (void)fclose(smtp_in); /* SMTP call any more. */
+ (void)fclose(smtp_out);
signal(SIGCHLD, SIG_DFL); /* Want to catch child */
-/* $Cambridge: exim/src/src/smtp_out.c,v 1.4 2005/02/17 11:58:26 ph10 Exp $ */
+/* $Cambridge: exim/src/src/smtp_out.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
debug_printf(" (timeout=%s)", readconf_printtime(timeout));
debug_printf("\n");
}
- close(sock);
+ (void)close(sock);
errno = save_errno;
return -1;
}
-/* $Cambridge: exim/src/src/spam.c,v 1.8 2005/06/22 15:44:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spam.c,v 1.9 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (!num_servers) {
log_write(0, LOG_MAIN|LOG_PANIC,
"spam acl condition: no useable spamd server addresses in spamd_address configuration option.");
- fclose(mbox_file);
+ (void)fclose(mbox_file);
return DEFER;
};
if ( (spamd_sock = ip_socket(SOCK_STREAM, AF_INET)) < 0) {
log_write(0, LOG_MAIN|LOG_PANIC,
"spam acl condition: error creating IP socket for spamd");
- fclose(mbox_file);
+ (void)fclose(mbox_file);
return DEFER;
};
current_server = 0;
if (current_server == start_server) {
log_write(0, LOG_MAIN|LOG_PANIC, "spam acl condition: all spamd servers failed");
- fclose(mbox_file);
- close(spamd_sock);
+ (void)fclose(mbox_file);
+ (void)close(spamd_sock);
return DEFER;
};
};
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: spamd: unable to acquire socket (%s)",
strerror(errno));
- fclose(mbox_file);
+ (void)fclose(mbox_file);
return DEFER;
}
log_write(0, LOG_MAIN|LOG_PANIC,
"malware acl condition: spamd: unable to connect to UNIX socket %s (%s)",
spamd_address, strerror(errno) );
- fclose(mbox_file);
- close(spamd_sock);
+ (void)fclose(mbox_file);
+ (void)close(spamd_sock);
return DEFER;
}
/* send our request */
if (send(spamd_sock, spamd_buffer, Ustrlen(spamd_buffer), 0) < 0) {
- close(spamd_sock);
+ (void)close(spamd_sock);
log_write(0, LOG_MAIN|LOG_PANIC,
"spam acl condition: spamd send failed: %s", strerror(errno));
- fclose(mbox_file);
- close(spamd_sock);
+ (void)fclose(mbox_file);
+ (void)close(spamd_sock);
return DEFER;
};
log_write(0, LOG_MAIN|LOG_PANIC,
"spam acl condition: timed out writing spamd socket");
}
- close(spamd_sock);
- fclose(mbox_file);
+ (void)close(spamd_sock);
+ (void)fclose(mbox_file);
return DEFER;
}
#endif
{
log_write(0, LOG_MAIN|LOG_PANIC,
"spam acl condition: %s on spamd socket", strerror(errno));
- close(spamd_sock);
- fclose(mbox_file);
+ (void)close(spamd_sock);
+ (void)fclose(mbox_file);
return DEFER;
}
if (offset + wrote != read) {
if (ferror(mbox_file)) {
log_write(0, LOG_MAIN|LOG_PANIC,
"spam acl condition: error reading spool file: %s", strerror(errno));
- close(spamd_sock);
- fclose(mbox_file);
+ (void)close(spamd_sock);
+ (void)fclose(mbox_file);
return DEFER;
}
- fclose(mbox_file);
+ (void)fclose(mbox_file);
/* we're done sending, close socket for writing */
shutdown(spamd_sock,SHUT_WR);
if((i <= 0) && (errno != 0)) {
log_write(0, LOG_MAIN|LOG_PANIC,
"spam acl condition: error reading from spamd socket: %s", strerror(errno));
- close(spamd_sock);
+ (void)close(spamd_sock);
return DEFER;
}
/* reading done */
- close(spamd_sock);
+ (void)close(spamd_sock);
/* dig in the spamd output and put the report in a multiline header, if requested */
if( sscanf(CS spamd_buffer,"SPAMD/%s 0 EX_OK\r\nContent-length: %*u\r\n\r\n%lf/%lf\r\n%n",
-/* $Cambridge: exim/src/src/spool_in.c,v 1.11 2005/06/22 15:44:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spool_in.c,v 1.12 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
log_write(L_skip_delivery,
LOG_MAIN,
"Spool file is locked (another process is handling this message)");
- close(deliver_datafile);
+ (void)close(deliver_datafile);
deliver_datafile = -1;
errno = 0;
return FALSE;
-/* $Cambridge: exim/src/src/spool_mbox.c,v 1.6 2005/06/06 18:49:35 tom Exp $ */
+/* $Cambridge: exim/src/src/spool_mbox.c,v 1.7 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
i = fwrite(mbox_delimiter, 1, Ustrlen(mbox_delimiter), mbox_file);
if (i != Ustrlen(mbox_delimiter)) {
debug_printf("error/short write on writing in: %s", mbox_path);
- fclose(mbox_file);
+ (void)fclose(mbox_file);
return NULL;
};
};
i = fwrite(my_envelope_from, 1, Ustrlen(my_envelope_from), mbox_file);
if (i != Ustrlen(my_envelope_from)) {
debug_printf("error/short write on writing in: %s", mbox_path);
- fclose(mbox_file);
+ (void)fclose(mbox_file);
return NULL;
};
};
i = fwrite(my_envelope_to, 1, Ustrlen(my_envelope_to), mbox_file);
if (i != Ustrlen(my_envelope_to)) {
debug_printf("error/short write on writing in: %s", mbox_path);
- fclose(mbox_file);
+ (void)fclose(mbox_file);
return NULL;
};
};
i = fwrite(my_headerlist->text, 1, my_headerlist->slen, mbox_file);
if (i != my_headerlist->slen) {
debug_printf("error/short write on writing in: %s", mbox_path);
- fclose(mbox_file);
+ (void)fclose(mbox_file);
return NULL;
};
break;
};
- fread(data_buffer, 1, 18, data_file);
+ (void)fread(data_buffer, 1, 18, data_file);
do {
j = fread(data_buffer, 1, sizeof(data_buffer), data_file);
i = fwrite(data_buffer, 1, j, mbox_file);
if (i != j) {
debug_printf("error/short write on writing in: %s", mbox_path);
- fclose(mbox_file);
- fclose(data_file);
+ (void)fclose(mbox_file);
+ (void)fclose(data_file);
return NULL;
};
};
} while (j > 0);
- fclose(data_file);
- fclose(mbox_file);
+ (void)fclose(data_file);
+ (void)fclose(mbox_file);
Ustrcpy(spooled_message_id, message_id);
spool_mbox_ok = 1;
};
-/* $Cambridge: exim/src/src/spool_out.c,v 1.7 2005/06/22 15:44:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spool_out.c,v 1.8 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
strerror(errno));
if (temp_name != NULL) Uunlink(temp_name);
-if (f != NULL) fclose(f);
+if (f != NULL) (void)fclose(f);
if (errmsg == NULL)
log_write(0, LOG_MAIN|LOG_PANIC_DIE, "%s", msg);
-/* $Cambridge: exim/src/src/tls-gnu.c,v 1.8 2005/06/16 14:10:13 ph10 Exp $ */
+/* $Cambridge: exim/src/src/tls-gnu.c,v 1.9 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (!sigalrm_seen)
{
- fclose(smtp_out);
- fclose(smtp_in);
+ (void)fclose(smtp_out);
+ (void)fclose(smtp_in);
}
return FAIL;
-/* $Cambridge: exim/src/src/transport.c,v 1.11 2005/06/22 15:44:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transport.c,v 1.12 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
CLEANUP:
/* unlink -K file */
- close(dk_fd);
+ (void)close(dk_fd);
Uunlink(dk_spool_name);
errno = save_errno;
return rc;
if ((write_pid = fork()) == 0)
{
BOOL rc;
- close(fd_read);
- close(pfd[pipe_read]);
+ (void)close(fd_read);
+ (void)close(pfd[pipe_read]);
nl_check_length = nl_escape_length = 0;
rc = internal_transport_write_message(addr, fd_write,
(options & ~(topt_use_crlf | topt_end_dot)),
size_limit, add_headers, remove_headers, NULL, NULL,
rewrite_rules, rewrite_existflags);
save_errno = errno;
- write(pfd[pipe_write], (void *)&rc, sizeof(BOOL));
- write(pfd[pipe_write], (void *)&save_errno, sizeof(int));
- write(pfd[pipe_write], (void *)&(addr->more_errno), sizeof(int));
+ (void)write(pfd[pipe_write], (void *)&rc, sizeof(BOOL));
+ (void)write(pfd[pipe_write], (void *)&save_errno, sizeof(int));
+ (void)write(pfd[pipe_write], (void *)&(addr->more_errno), sizeof(int));
_exit(0);
}
save_errno = errno;
/* Parent process: close our copy of the writing subprocess' pipes. */
-close(pfd[pipe_write]);
-close(fd_write);
+(void)close(pfd[pipe_write]);
+(void)close(fd_write);
fd_write = -1;
/* Writing process creation failed */
TIDY_UP:
save_errno = errno;
-close(fd_read);
-if (fd_write > 0) close(fd_write);
+(void)close(fd_read);
+if (fd_write > 0) (void)close(fd_write);
if (!yield)
{
if (rc == 0)
{
BOOL ok;
- read(pfd[pipe_read], (void *)&ok, sizeof(BOOL));
+ (void)read(pfd[pipe_read], (void *)&ok, sizeof(BOOL));
if (!ok)
{
- read(pfd[pipe_read], (void *)&save_errno, sizeof(int));
- read(pfd[pipe_read], (void *)&(addr->more_errno), sizeof(int));
+ (void)read(pfd[pipe_read], (void *)&save_errno, sizeof(int));
+ (void)read(pfd[pipe_read], (void *)&(addr->more_errno), sizeof(int));
yield = FALSE;
}
}
}
}
}
-close(pfd[pipe_read]);
+(void)close(pfd[pipe_read]);
/* If there have been no problems we can now add the terminating "." if this is
SMTP output, turning off escaping beforehand. If the last character from the
if (socket_fd != 0)
{
- dup2(socket_fd, 0);
- close(socket_fd);
+ (void)dup2(socket_fd, 0);
+ (void)close(socket_fd);
}
DEBUG(D_exec) debug_print_argv(argv);
-/* $Cambridge: exim/src/src/transports/appendfile.c,v 1.9 2005/06/22 15:44:38 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transports/appendfile.c,v 1.10 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
(void)ip_connect(sock, host_af, h->address, ntohs(sp->s_port), 0);
rc = send(sock, buffer, Ustrlen(buffer) + 1, 0);
- close(sock);
+ (void)close(sock);
if (rc >= 0) break;
DEBUG(D_transport)
if (cfd >= 0)
{
transport_instance *tt = check_file_format(cfd, tblock, addr);
- close(cfd);
+ (void)close(cfd);
/* If another transport is indicated, call it and return; if no transport
was found, just return - the error data will have been set up.*/
sufficiently worried. */
if ((rc = Ulink(hitchname, lockname)) != 0) fstat(hd, &statbuf);
- close(hd);
+ (void)close(hd);
Uunlink(hitchname);
if (rc != 0 && statbuf.st_nlink != 2)
{
DEBUG(D_transport) debug_printf("failed to lock %s: %s\n", mbx_lockname,
strerror(errno));
- close(mbx_lockfd);
+ (void)close(mbx_lockfd);
mbx_lockfd = -1;
}
else
DEBUG(D_transport)
debug_printf("fcntl(), flock(), or MBX locking failed - retrying\n");
- close(fd);
+ (void)close(fd);
fd = -1;
use_lstat = TRUE; /* Reset to use lstat first */
addr->transport_return = PANIC;
addr->message = string_sprintf("fdopen of %s ("
"for %s transport) failed", filename, tblock->name);
- close(fd);
+ (void)close(fd);
Uunlink(filename);
return FALSE;
}
addr->message = string_sprintf("Expansion of \"%s\" (mailstore "
"prefix for %s transport) failed: %s", ob->mailstore_prefix,
tblock->name, expand_string_message);
- fclose(env_file);
+ (void)fclose(env_file);
Uunlink(filename);
return FALSE;
}
addr->message = string_sprintf("Expansion of \"%s\" (mailstore "
"suffix for %s transport) failed: %s", ob->mailstore_suffix,
tblock->name, expand_string_message);
- fclose(env_file);
+ (void)fclose(env_file);
Uunlink(filename);
return FALSE;
}
/* Preserve errno while closing the temporary file. */
mbx_save_errno = errno;
- fclose(temp_file);
+ (void)fclose(temp_file);
errno = mbx_save_errno;
}
#endif /* SUPPORT_MBX */
maildir_record_length(maildirsize_fd, message_size);
maildir_save_errno = errno; /* Preserve errno while closing the file */
-close(maildirsize_fd);
+(void)close(maildirsize_fd);
errno = maildir_save_errno;
#endif /* SUPPORT_MAILDIR */
debug_printf("unlinking MBX lock file %s\n", mbx_lockname);
Uunlink(mbx_lockname);
}
- close(mbx_lockfd);
+ (void)close(mbx_lockfd);
}
#endif /* SUPPORT_MBX */
-/* $Cambridge: exim/src/src/transports/autoreply.c,v 1.4 2005/06/16 14:10:14 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transports/autoreply.c,v 1.5 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
uschar *ptr = log_buffer;
sprintf(CS ptr, "%s\n previously sent to %.200s\n", tod_stamp(tod_log), to);
while(*ptr) ptr++;
- write(log_fd, log_buffer, ptr - log_buffer);
- close(log_fd);
+ (void)write(log_fd, log_buffer, ptr - log_buffer);
+ (void)close(log_fd);
}
goto END_OFF;
}
/* End the message and wait for the child process to end; no timeout. */
-fclose(f);
+(void)fclose(f);
rc = child_close(pid, 0);
/* Update the "sent to" log whatever the yield. This errs on the side of
}
memcpy(cache_time, &now, sizeof(time_t));
- write(cache_fd, from, size);
+ (void)write(cache_fd, from, size);
}
/* Update DBM file */
" %s\n", headers);
while(*ptr) ptr++;
}
- write(log_fd, log_buffer, ptr - log_buffer);
- close(log_fd);
+ (void)write(log_fd, log_buffer, ptr - log_buffer);
+ (void)close(log_fd);
}
else DEBUG(D_transport) debug_printf("Failed to open log file %s for %s "
"transport: %s\n", logfile, tblock->name, strerror(errno));
END_OFF:
if (dbm_file != NULL) EXIM_DBCLOSE(dbm_file);
-if (cache_fd > 0) close(cache_fd);
+if (cache_fd > 0) (void)close(cache_fd);
DEBUG(D_transport) debug_printf("%s transport succeeded\n", tblock->name);
-/* $Cambridge: exim/src/src/transports/lmtp.c,v 1.4 2005/02/17 11:58:27 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transports/lmtp.c,v 1.5 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
(void)child_close(pid, timeout);
-if (fd_in >= 0) (void) close(fd_in);
-if (fd_out >= 0) (void) fclose(out);
+if (fd_in >= 0) (void)close(fd_in);
+if (fd_out >= 0) (void)fclose(out);
DEBUG(D_transport)
debug_printf("%s transport yields %d\n", tblock->name, yield);
-/* $Cambridge: exim/src/src/transports/pipe.c,v 1.6 2005/05/10 11:13:09 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transports/pipe.c,v 1.7 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
addr->message = string_sprintf(
"Failed to create process for handling output in %s transport",
tblock->name);
- close(fd_in);
- close(fd_out);
+ (void)close(fd_in);
+ (void)close(fd_out);
return FALSE;
}
if (outpid == 0)
{
int count = 0;
- close(fd_in);
+ (void)close(fd_in);
set_process_info("reading output from |%s", cmd);
while ((rc = read(fd_out, big_buffer, big_buffer_size)) > 0)
{
break;
}
}
- close(fd_out);
+ (void)close(fd_out);
_exit(0);
}
-close(fd_out); /* Not used in this process */
+(void)close(fd_out); /* Not used in this process */
/* Carrying on now with the main parent process. Attempt to write the message
-/* $Cambridge: exim/src/src/transports/smtp.c,v 1.11 2005/04/28 13:06:32 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transports/smtp.c,v 1.12 2005/06/27 14:29:45 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
specified in the transports, and therefore not visible at top level, in which
case continue_more won't get set. */
-close(inblock.sock);
+(void)close(inblock.sock);
continue_transport = NULL;
continue_hostname = NULL;
return yield;
(void)smtp_write_command(&outblock, FALSE, "QUIT\r\n");
(void)smtp_read_response(&inblock, buffer, sizeof(buffer), '2',
ob->command_timeout);
-close(inblock.sock);
+(void)close(inblock.sock);
}
-/* $Cambridge: exim/src/src/transports/tf_maildir.c,v 1.6 2005/06/16 14:10:14 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transports/tf_maildir.c,v 1.7 2005/06/27 14:29:45 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
RECALCULATE:
- if (fd >= 0) close(fd);
+ if (fd >= 0) (void)close(fd);
old_latest = 0;
filecount = 0;
size = maildir_compute_size(path, &filecount, &old_latest, regex, dir_regex,
len = Ustrlen(buffer);
if (write(fd, buffer, len) != len || Urename(tempname, filename) < 0)
{
- close(fd);
+ (void)close(fd);
fd = -1;
}
}
DEBUG(D_transport) debug_printf("abandoning maildirsize because of "
"a later subdirectory modification\n");
(void)Uunlink(filename);
- close(fd);
+ (void)close(fd);
fd = -1;
}
}
-/* $Cambridge: exim/src/src/verify.c,v 1.21 2005/06/23 10:02:13 ph10 Exp $ */
+/* $Cambridge: exim/src/src/verify.c,v 1.22 2005/06/27 14:29:44 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* End the SMTP conversation and close the connection. */
if (send_quit) (void)smtp_write_command(&outblock, FALSE, "QUIT\r\n");
- close(inblock.sock);
+ (void)close(inblock.sock);
} /* Loop through all hosts, while !done */
/* If we get here with done == TRUE, a successful callout happened, and yield
DEBUG(D_ident) debug_printf("sender_ident = %s\n", sender_ident);
END_OFF:
-close(sock);
+(void)close(sock);
return;
}