-$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.168 2005/06/22 14:45:05 ph10 Exp $
+$Cambridge: exim/doc/doc-txt/ChangeLog,v 1.169 2005/06/22 15:44:37 ph10 Exp $
Change log file for Exim from version 4.21
-------------------------------------------
DB library. This is a regular occurrence (often caused by mis-matched
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.
+
Exim version 4.51
-----------------
-/* $Cambridge: exim/src/src/bmi_spam.c,v 1.3 2005/02/17 11:58:25 ph10 Exp $ */
+/* $Cambridge: exim/src/src/bmi_spam.c,v 1.4 2005/06/22 15:44:37 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
int rule_int = -1;
/* try to translate to int */
- sscanf(rule_num, "%d", &rule_int);
+ (void)sscanf(rule_num, "%d", &rule_int);
if (rule_int > 0) {
debug_printf("checking rule #%d\n", rule_int);
/* check if rule fired on the message */
-/* $Cambridge: exim/src/src/daemon.c,v 1.11 2005/06/21 14:14:55 ph10 Exp $ */
+/* $Cambridge: exim/src/src/daemon.c,v 1.12 2005/06/22 15:44:37 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
f = Ufopen(pid_file_path, "wb");
if (f != NULL)
{
- fprintf(f, "%d\n", (int)getpid());
- fchmod(fileno(f), 0644);
- fclose(f);
+ (void)fprintf(f, "%d\n", (int)getpid());
+ (void)fchmod(fileno(f), 0644);
+ (void)fclose(f);
DEBUG(D_any) debug_printf("pid written to %s\n", pid_file_path);
}
else
-/* $Cambridge: exim/src/src/dbfn.c,v 1.4 2005/06/22 14:45:05 ph10 Exp $ */
+/* $Cambridge: exim/src/src/dbfn.c,v 1.5 2005/06/22 15:44:37 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (Ustat(buffer, &statbuf) >= 0 && statbuf.st_uid != exim_uid)
{
DEBUG(D_hints_lookup) debug_printf("ensuring %s is owned by exim\n", buffer);
- Uchown(buffer, exim_uid, exim_gid);
+ (void)Uchown(buffer, exim_uid, exim_gid);
}
}
}
-/* $Cambridge: exim/src/src/deliver.c,v 1.18 2005/06/16 14:10:13 ph10 Exp $ */
+/* $Cambridge: exim/src/src/deliver.c,v 1.19 2005/06/22 15:44:37 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (fd >= 0)
{
- fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
+ (void)fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
if (fchown(fd, exim_uid, exim_gid) < 0)
{
*error = US"chown";
gid/uid. */
close(pfd[pipe_read]);
- fcntl(pfd[pipe_write], F_SETFD, fcntl(pfd[pipe_write], F_GETFD) |
+ (void)fcntl(pfd[pipe_write], F_SETFD, fcntl(pfd[pipe_write], F_GETFD) |
FD_CLOEXEC);
exim_setugid(uid, gid, use_initgroups,
string_sprintf("local delivery to %s <%s> transport=%s", addr->local_part,
distinguishes between EOF and no-more-data. */
#ifdef O_NONBLOCK
- fcntl(pfd[pipe_read], F_SETFL, O_NONBLOCK);
+ (void)fcntl(pfd[pipe_read], F_SETFL, O_NONBLOCK);
#else
- fcntl(pfd[pipe_read], F_SETFL, O_NDELAY);
+ (void)fcntl(pfd[pipe_read], F_SETFL, O_NDELAY);
#endif
/* If the maximum number of subprocesses already exist, wait for a process
a new process that may be forked to do another delivery down the same
SMTP connection. */
- fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
+ (void)fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
/* Close open file descriptors for the pipes of other processes
that are running in parallel. */
/* Set the close-on-exec flag */
- fcntl(deliver_datafile, F_SETFD, fcntl(deliver_datafile, F_GETFD) |
+ (void)fcntl(deliver_datafile, F_SETFD, fcntl(deliver_datafile, F_GETFD) |
FD_CLOEXEC);
/* Set the uid/gid of this process; bombs out on failure. */
that the mode is correct - the group setting doesn't always seem to get
set automatically. */
- fcntl(journal_fd, F_SETFD, fcntl(journal_fd, F_GETFD) | FD_CLOEXEC);
- fchown(journal_fd, exim_uid, exim_gid);
- fchmod(journal_fd, SPOOL_MODE);
+ (void)fcntl(journal_fd, F_SETFD, fcntl(journal_fd, F_GETFD) | FD_CLOEXEC);
+ (void)fchown(journal_fd, exim_uid, exim_gid);
+ (void)fchmod(journal_fd, SPOOL_MODE);
}
-/* $Cambridge: exim/src/src/directory.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
+/* $Cambridge: exim/src/src/directory.c,v 1.3 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Set the ownership if necessary. */
- if (use_chown) Uchown(buffer, exim_uid, exim_gid);
+ if (use_chown) (void)Uchown(buffer, exim_uid, exim_gid);
/* It appears that any mode bits greater than 0777 are ignored by
mkdir(), at least on some operating systems. Therefore, if the mode
contains any such bits, do an explicit mode setting. */
- if ((mode & 0777000) != 0) Uchmod(buffer, mode);
+ if ((mode & 0777000) != 0) (void)Uchmod(buffer, mode);
}
*p++ = c;
}
-/* $Cambridge: exim/src/src/exim_dbutil.c,v 1.5 2005/06/14 10:32:01 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim_dbutil.c,v 1.6 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
printf("No previous record name is set\n");
continue;
}
- sscanf(CS buffer, "%s %s", field, value);
+ (void)sscanf(CS buffer, "%s %s", field, value);
}
else
{
name[0] = 0;
- sscanf(CS buffer, "%s %s %s", name, field, value);
+ (void)sscanf(CS buffer, "%s %s %s", name, field, value);
}
/* Handle an update request */
-/* $Cambridge: exim/src/src/exim_lock.c,v 1.1 2004/10/07 10:39:01 ph10 Exp $ */
+/* $Cambridge: exim/src/src/exim_lock.c,v 1.2 2005/06/22 15:44:38 ph10 Exp $ */
/* A program to lock a file exactly as Exim would, for investigation of
interlocking problems.
goto CLEAN_UP;
}
- chmod (tempname, 0600);
+ (void)chmod(tempname, 0600);
if (apply_lock(md, F_WRLCK, use_fcntl, lock_fcntl_timeout, use_flock,
lock_flock_timeout) >= 0)
struct stat strestore;
struct utimbuf ut;
stat(filename, &strestore);
- system(command);
+ (void)system(command);
ut.actime = strestore.st_atime;
ut.modtime = strestore.st_mtime;
utime(filename, &ut);
}
-else system(command);
+else (void)system(command);
/* Remove the locks and exit. Unlink the /tmp file if we can get an exclusive
lock on the mailbox. This should be a non-blocking lock call, as there is no
-/* $Cambridge: exim/src/src/expand.c,v 1.34 2005/06/22 10:17:23 ph10 Exp $ */
+/* $Cambridge: exim/src/src/expand.c,v 1.35 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
uschar *now = prvs_daystamp(0);
unsigned int inow = 0,iexpire = 1;
- sscanf(CS now,"%u",&inow);
- sscanf(CS daystamp,"%u",&iexpire);
+ (void)sscanf(CS now,"%u",&inow);
+ (void)sscanf(CS daystamp,"%u",&iexpire);
/* When "iexpire" is < 7, a "flip" has occured.
Adjust "inow" accordingly. */
-/* $Cambridge: exim/src/src/host.c,v 1.9 2005/02/17 11:58:26 ph10 Exp $ */
+/* $Cambridge: exim/src/src/host.c,v 1.10 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Handle IPv4 address */
-sscanf(CS address, "%d.%d.%d.%d", x, x+1, x+2, x+3);
+(void)sscanf(CS address, "%d.%d.%d.%d", x, x+1, x+2, x+3);
bin[v4offset] = (x[0] << 24) + (x[1] << 16) + (x[2] << 8) + x[3];
return v4offset+1;
}
else if (Ustrcmp(buffer, "no_search_parents") == 0) search_parents = FALSE;
else if (Ustrncmp(buffer, "retrans", 7) == 0)
{
- sscanf(CS(buffer+8), "%d", &dns_retrans);
+ (void)sscanf(CS(buffer+8), "%d", &dns_retrans);
_res.retrans = dns_retrans;
}
else if (Ustrncmp(buffer, "retry", 5) == 0)
{
- sscanf(CS(buffer+6), "%d", &dns_retry);
+ (void)sscanf(CS(buffer+6), "%d", &dns_retry);
_res.retry = dns_retry;
}
else if (alldigits(buffer))
-/* $Cambridge: exim/src/src/log.c,v 1.3 2005/03/29 15:19:25 ph10 Exp $ */
+/* $Cambridge: exim/src/src/log.c,v 1.4 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (*fd >= 0)
{
- fcntl(*fd, F_SETFD, fcntl(*fd, F_GETFD) | FD_CLOEXEC);
+ (void)fcntl(*fd, F_SETFD, fcntl(*fd, F_GETFD) | FD_CLOEXEC);
return;
}
if (*fd >= 0)
{
- fcntl(*fd, F_SETFD, fcntl(*fd, F_GETFD) | FD_CLOEXEC);
+ (void)fcntl(*fd, F_SETFD, fcntl(*fd, F_GETFD) | FD_CLOEXEC);
return;
}
-/* $Cambridge: exim/src/src/receive.c,v 1.18 2005/05/23 15:28:38 fanf2 Exp $ */
+/* $Cambridge: exim/src/src/receive.c,v 1.19 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* Make sure the file's group is the Exim gid, and double-check the mode
because the group setting doesn't always get set automatically. */
-fchown(data_fd, exim_uid, exim_gid);
-fchmod(data_fd, SPOOL_MODE);
+(void)fchown(data_fd, exim_uid, exim_gid);
+(void)fchmod(data_fd, SPOOL_MODE);
/* We now have data file open. Build a stream for it and lock it. We lock only
the first line of the file (containing the message ID) because otherwise there
-/* $Cambridge: exim/src/src/spam.c,v 1.7 2005/06/10 13:29:36 tom Exp $ */
+/* $Cambridge: exim/src/src/spam.c,v 1.8 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
pollfd.fd = spamd_sock;
pollfd.events = POLLOUT;
#endif
- fcntl(spamd_sock, F_SETFL, O_NONBLOCK);
+ (void)fcntl(spamd_sock, F_SETFL, O_NONBLOCK);
do {
read = fread(spamd_buffer,1,sizeof(spamd_buffer),mbox_file);
if (read > 0) {
-/* $Cambridge: exim/src/src/spool_in.c,v 1.10 2005/04/07 10:10:01 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spool_in.c,v 1.11 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
Unix systems it doesn't make any difference as long as Exim is consistent in
what it locks. */
-fcntl(deliver_datafile, F_SETFD, fcntl(deliver_datafile, F_GETFD) |
+(void)fcntl(deliver_datafile, F_SETFD, fcntl(deliver_datafile, F_GETFD) |
FD_CLOEXEC);
lock_data.l_type = F_WRLCK;
if (*p == ' ')
{
*p++ = 0;
- sscanf(CS p, "%d,%d", &dummy, &pno);
+ (void)sscanf(CS p, "%d,%d", &dummy, &pno);
}
}
else if (*p == ' ')
{
*p++ = 0;
- sscanf(CS p, "%d", &pno);
+ (void)sscanf(CS p, "%d", &pno);
}
/* Handle current format Exim 4 spool files */
else if (*p == '#')
{
int flags;
- sscanf(CS p+1, "%d", &flags);
+ (void)sscanf(CS p+1, "%d", &flags);
if ((flags & 0x01) != 0) /* one_time data exists */
{
int len;
while (isdigit(*(--p)) || *p == ',' || *p == '-');
- sscanf(CS p+1, "%d,%d", &len, &pno);
+ (void)sscanf(CS p+1, "%d,%d", &len, &pno);
*p = 0;
if (len > 0)
{
int i;
if (!isdigit(n)) goto SPOOL_FORMAT_ERROR;
- ungetc(n, f);
- fscanf(f, "%d%c ", &n, flag);
+ (void)ungetc(n, f);
+ (void)fscanf(f, "%d%c ", &n, flag);
if (flag[0] != '*') message_size += n; /* Omit non-transmitted headers */
if (read_headers)
-/* $Cambridge: exim/src/src/spool_out.c,v 1.6 2005/02/17 11:58:26 ph10 Exp $ */
+/* $Cambridge: exim/src/src/spool_out.c,v 1.7 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
if (fd >= 0)
{
- fchown(fd, exim_uid, exim_gid);
- fchmod(fd, SPOOL_MODE);
+ (void)fchown(fd, exim_uid, exim_gid);
+ (void)fchmod(fd, SPOOL_MODE);
}
return fd;
-/* $Cambridge: exim/src/src/transport.c,v 1.10 2005/06/20 11:20:41 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transport.c,v 1.11 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
yield = FALSE;
write_pid = (pid_t)(-1);
-fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
+(void)fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
filter_pid = child_open(transport_filter_argv, NULL, 077, &fd_write, &fd_read,
FALSE);
-fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) & ~FD_CLOEXEC);
+(void)fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) & ~FD_CLOEXEC);
if (filter_pid < 0) goto TIDY_UP; /* errno set */
DEBUG(D_transport)
-/* $Cambridge: exim/src/src/transports/appendfile.c,v 1.8 2005/06/16 14:10:14 ph10 Exp $ */
+/* $Cambridge: exim/src/src/transports/appendfile.c,v 1.9 2005/06/22 15:44:38 ph10 Exp $ */
/*************************************************
* Exim - an Internet mail transport agent *
/* We have successfully created and opened the file. Ensure that the group
and the mode are correct. */
- Uchown(filename, uid, gid);
- Uchmod(filename, mode);
+ (void)Uchown(filename, uid, gid);
+ (void)Uchmod(filename, mode);
}
goto RETURN;
}
- Uchmod(mbx_lockname, 0600);
+ (void)Uchmod(mbx_lockname, 0600);
if (apply_lock(mbx_lockfd, F_WRLCK, ob->use_fcntl,
ob->lock_fcntl_timeout, ob->use_flock, ob->lock_flock_timeout) >= 0)
/* Why are these here? Put in because they are present in the non-maildir
directory case above. */
- Uchown(filename, uid, gid);
- Uchmod(filename, mode);
+ (void)Uchown(filename, uid, gid);
+ (void)Uchmod(filename, mode);
}
#endif /* SUPPORT_MAILDIR */
/* Why are these here? Put in because they are present in the non-maildir
directory case above. */
- Uchown(filename, uid, gid);
- Uchmod(filename, mode);
+ (void)Uchown(filename, uid, gid);
+ (void)Uchmod(filename, mode);
/* Built a C stream from the open file descriptor. */
Uunlink(filename);
return FALSE;
}
- Uchown(dataname, uid, gid);
- Uchmod(dataname, mode);
+ (void)Uchown(dataname, uid, gid);
+ (void)Uchmod(dataname, mode);
}
#endif /* SUPPORT_MAILSTORE */
/* In all cases of writing to a new file, ensure that the file which is
going to be renamed has the correct ownership and mode. */
- Uchown(filename, uid, gid);
- Uchmod(filename, mode);
+ (void)Uchown(filename, uid, gid);
+ (void)Uchmod(filename, mode);
}
investigated so far have ftruncate(), whereas not all have the F_FREESP
fcntl() call (BSDI & FreeBSD do not). */
- if (!isdirectory) ftruncate(fd, saved_size);
+ if (!isdirectory) (void)ftruncate(fd, saved_size);
}
/* Handle successful writing - we want the modification time to be now for