[exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog exim…

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Philip Hazel
日付:  
To: exim-cvs
題目: [exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog exim/exim-src/src acl.c buildconfig.c child.c daemon.c dbfn.c deliver.c demime.c dk.c exim_dbmbuild.c exim_dbutil.c exim_lock.c expand.c filte
ph10 2005/06/27 15:29:45 BST

  Modified files:
    exim-doc/doc-txt     ChangeLog 
    exim-src/src         acl.c buildconfig.c child.c daemon.c 
                         dbfn.c deliver.c demime.c dk.c 
                         exim_dbmbuild.c exim_dbutil.c exim_lock.c 
                         expand.c filter.c filtertest.c ip.c log.c 
                         malware.c match.c mime.c moan.c os.c 
                         parse.c queue.c rda.c readconf.c 
                         receive.c regex.c smtp_in.c smtp_out.c 
                         spam.c spool_in.c spool_mbox.c 
                         spool_out.c tls-gnu.c transport.c 
                         verify.c 
    exim-src/src/auths   pwcheck.c 
    exim-src/src/lookups cdb.c dbmdb.c lsearch.c 
    exim-src/src/routers iplookup.c queryprogram.c 
    exim-src/src/transports appendfile.c autoreply.c lmtp.c pipe.c 
                            smtp.c tf_maildir.c 
  Log:
  Added lots of "(void)" casts to standard function calls.


  Revision  Changes    Path
  1.174     +6 -4      exim/exim-doc/doc-txt/ChangeLog
  1.41      +1 -1      exim/exim-src/src/acl.c
  1.2       +7 -7      exim/exim-src/src/auths/pwcheck.c
  1.10      +5 -5      exim/exim-src/src/buildconfig.c
  1.5       +16 -16    exim/exim-src/src/child.c
  1.13      +14 -12    exim/exim-src/src/daemon.c
  1.6       +3 -3      exim/exim-src/src/dbfn.c
  1.20      +46 -46    exim/exim-src/src/deliver.c
  1.6       +10 -10    exim/exim-src/src/demime.c
  1.5       +2 -2      exim/exim-src/src/dk.c
  1.4       +2 -2      exim/exim-src/src/exim_dbmbuild.c
  1.7       +3 -3      exim/exim-src/src/exim_dbutil.c
  1.3       +1 -1      exim/exim-src/src/exim_lock.c
  1.36      +4 -4      exim/exim-src/src/expand.c
  1.4       +2 -2      exim/exim-src/src/filter.c
  1.6       +1 -1      exim/exim-src/src/filtertest.c
  1.3       +1 -1      exim/exim-src/src/ip.c
  1.5       +7 -7      exim/exim-src/src/log.c
  1.3       +1 -1      exim/exim-src/src/lookups/cdb.c
  1.3       +3 -3      exim/exim-src/src/lookups/dbmdb.c
  1.4       +1 -1      exim/exim-src/src/lookups/lsearch.c
  1.10      +64 -64    exim/exim-src/src/malware.c
  1.7       +4 -4      exim/exim-src/src/match.c
  1.8       +2 -2      exim/exim-src/src/mime.c
  1.3       +3 -3      exim/exim-src/src/moan.c
  1.3       +1 -1      exim/exim-src/src/os.c
  1.5       +3 -3      exim/exim-src/src/parse.c
  1.8       +8 -8      exim/exim-src/src/queue.c
  1.8       +20 -20    exim/exim-src/src/rda.c
  1.11      +2 -2      exim/exim-src/src/readconf.c
  1.20      +10 -10    exim/exim-src/src/receive.c
  1.6       +4 -4      exim/exim-src/src/regex.c
  1.3       +2 -2      exim/exim-src/src/routers/iplookup.c
  1.5       +2 -2      exim/exim-src/src/routers/queryprogram.c
  1.20      +4 -4      exim/exim-src/src/smtp_in.c
  1.5       +1 -1      exim/exim-src/src/smtp_out.c
  1.9       +19 -19    exim/exim-src/src/spam.c
  1.12      +1 -1      exim/exim-src/src/spool_in.c
  1.7       +9 -9      exim/exim-src/src/spool_mbox.c
  1.8       +1 -1      exim/exim-src/src/spool_out.c
  1.9       +2 -2      exim/exim-src/src/tls-gnu.c
  1.12      +16 -16    exim/exim-src/src/transport.c
  1.10      +11 -11    exim/exim-src/src/transports/appendfile.c
  1.5       +7 -7      exim/exim-src/src/transports/autoreply.c
  1.5       +2 -2      exim/exim-src/src/transports/lmtp.c
  1.7       +5 -5      exim/exim-src/src/transports/pipe.c
  1.12      +2 -2      exim/exim-src/src/transports/smtp.c
  1.7       +3 -3      exim/exim-src/src/transports/tf_maildir.c
  1.22      +2 -2      exim/exim-src/src/verify.c


  Index: ChangeLog
  ===================================================================
  RCS file: /home/cvs/exim/exim-doc/doc-txt/ChangeLog,v
  retrieving revision 1.173
  retrieving revision 1.174
  diff -u -r1.173 -r1.174
  --- ChangeLog    27 Jun 2005 10:52:20 -0000    1.173
  +++ ChangeLog    27 Jun 2005 14:29:43 -0000    1.174
  @@ -1,4 +1,4 @@
  -$Cambridge: exim/exim-doc/doc-txt/ChangeLog,v 1.173 2005/06/27 10:52:20 ph10 Exp $
  +$Cambridge: exim/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
   -------------------------------------------
  @@ -182,10 +182,12 @@
         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


  Index: acl.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/acl.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- acl.c    20 Jun 2005 13:58:22 -0000    1.40
  +++ acl.c    27 Jun 2005 14:29:43 -0000    1.41
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/acl.c,v 1.40 2005/06/20 13:58:22 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/acl.c,v 1.41 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -3132,7 +3132,7 @@
         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);


  Index: buildconfig.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/buildconfig.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- buildconfig.c    17 Jun 2005 13:52:15 -0000    1.9
  +++ buildconfig.c    27 Jun 2005 14:29:43 -0000    1.10
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/buildconfig.c,v 1.9 2005/06/17 13:52:15 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/buildconfig.c,v 1.10 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -181,7 +181,7 @@
   if (base == NULL)
     {
     printf("*** Buildconfig: failed to open Makefile\n");
  -  fclose(new);
  +  (void)fclose(new);
     exit(1);
     }


  @@ -293,7 +293,7 @@
     }


fprintf(new, "\n");
-fclose(base);
+(void)fclose(base);


   /* Now handle the macros listed in the defaults */
  @@ -302,7 +302,7 @@
   if (base == NULL)
     {
     printf("*** Buildconfig: failed to open ../src/config.h.defaults\n");
  -  fclose(new);
  +  (void)fclose(new);
     exit(1);
     }


  @@ -815,7 +815,7 @@
       }
     }


-fclose(base);
+(void)fclose(base);

/* If any AUTH macros were defined, ensure that SUPPORT_CRYPTEQ is also
defined. */
@@ -829,7 +829,7 @@
/* End off */

fprintf(new, "\n/* End of config.h */\n");
-fclose(new);
+(void)fclose(new);
return 0;
}


  Index: child.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/child.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- child.c    17 Feb 2005 11:58:25 -0000    1.4
  +++ child.c    27 Jun 2005 14:29:43 -0000    1.5
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/child.c,v 1.4 2005/02/17 11:58:25 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/child.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -32,9 +32,9 @@
   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);
   }



  @@ -201,7 +201,7 @@
   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,
  @@ -217,7 +217,7 @@
   pipe. */


save_errno = errno;
-close(pfd[pipe_read]);
+(void)close(pfd[pipe_read]);

/* Fork succeeded */

@@ -229,7 +229,7 @@

/* Fork failed */

  -close(pfd[pipe_write]);
  +(void)close(pfd[pipe_write]);
   errno = save_errno;
   return (pid_t)(-1);
   }
  @@ -280,8 +280,8 @@
   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);
     }


  @@ -301,14 +301,14 @@
     {
     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. */


@@ -338,8 +338,8 @@
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 */

@@ -352,8 +352,8 @@

/* 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);
}

  Index: daemon.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/daemon.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- daemon.c    22 Jun 2005 15:44:37 -0000    1.12
  +++ daemon.c    27 Jun 2005 14:29:43 -0000    1.13
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/daemon.c,v 1.12 2005/06/22 15:44:37 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/daemon.c,v 1.13 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -419,7 +419,7 @@
     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;
  @@ -603,8 +603,8 @@


         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. */
  @@ -691,7 +691,7 @@
         strerror(errno));
     smtp_out = NULL;
     }
  -else close(accept_socket);
  +else (void)close(accept_socket);


   if (smtp_in != NULL)
     {
  @@ -700,7 +700,7 @@
         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. */
  @@ -1208,9 +1208,9 @@
     {
     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 */


  @@ -1320,7 +1320,7 @@
           {
           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);
  @@ -1366,7 +1366,7 @@


       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
  @@ -1613,7 +1613,8 @@


           /* 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. */


  @@ -1857,7 +1858,8 @@
       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;


  Index: dbfn.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/dbfn.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- dbfn.c    22 Jun 2005 15:44:37 -0000    1.5
  +++ dbfn.c    27 Jun 2005 14:29:43 -0000    1.6
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/dbfn.c,v 1.5 2005/06/22 15:44:37 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/dbfn.c,v 1.6 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -141,7 +141,7 @@
     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;
     }
  @@ -229,7 +229,7 @@
           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;
     }
  @@ -261,7 +261,7 @@
   dbfn_close(open_db *dbblock)
   {
   EXIM_DBCLOSE(dbblock->dbptr);
  -close(dbblock->lockfd);
  +(void)close(dbblock->lockfd);
   }




  Index: deliver.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/deliver.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- deliver.c    22 Jun 2005 15:44:37 -0000    1.19
  +++ deliver.c    27 Jun 2005 14:29:43 -0000    1.20
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/deliver.c,v 1.19 2005/06/22 15:44:37 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/deliver.c,v 1.20 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -798,7 +798,7 @@
             log_write(0, LOG_MAIN, "<%s>: %s transport output: %s",
               addr->address, tb->name, s);
             }
  -        fclose(f);
  +        (void)fclose(f);
           }
         }


  @@ -829,7 +829,7 @@
       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
  @@ -1728,7 +1728,7 @@
     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,
  @@ -1794,13 +1794,13 @@
       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
  @@ -1809,8 +1809,8 @@


       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 */
  @@ -1818,15 +1818,15 @@
       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);
     }
  @@ -1845,7 +1845,7 @@
   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)
     {
  @@ -1895,7 +1895,7 @@
       }
     }


-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
@@ -1998,7 +1998,7 @@

         /* Close and wait for child process to complete, without a timeout. */


  -      fclose(f);
  +      (void)fclose(f);
         (void)child_close(pid, 0);
         }
       }
  @@ -2885,7 +2885,7 @@
   /* 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,
@@ -3707,8 +3707,8 @@

     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;
  @@ -3754,7 +3754,7 @@
       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
  @@ -3764,7 +3764,7 @@
       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);
  @@ -3788,7 +3788,7 @@
       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);
  @@ -3817,7 +3817,7 @@
         {
         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
  @@ -3827,7 +3827,7 @@


       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'
  @@ -3857,7 +3857,7 @@
             sprintf(CS ptr, "%.512s", addr->peerdn);
             while(*ptr++);
             }
  -        write(fd, big_buffer, ptr - big_buffer);
  +        (void)write(fd, big_buffer, ptr - big_buffer);
           }
         #endif


  @@ -3877,7 +3877,7 @@
             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. */
  @@ -3913,7 +3913,7 @@
           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
  @@ -3923,20 +3923,20 @@


       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);
  @@ -4517,7 +4517,7 @@
         readconf_printtime(keep_malformed));
       }


  -  close(deliver_datafile);
  +  (void)close(deliver_datafile);
     deliver_datafile = -1;
     return continue_closedown();   /* yields DELIVER_NOT_ATTEMPTED */
     }
  @@ -4543,7 +4543,7 @@
       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);
     }
  @@ -4558,7 +4558,7 @@


   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 */
  @@ -4618,7 +4618,7 @@
             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 */
  @@ -4753,7 +4753,7 @@


     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));
  @@ -6292,7 +6292,7 @@
             else
               {
               while ((ch = fgetc(fm)) != EOF) fputc(ch, f);
  -            fclose(fm);
  +            (void)fclose(fm);
               }
             Uunlink(addr->return_filename);


  @@ -6365,13 +6365,13 @@
           {
           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. */
  @@ -6738,7 +6738,7 @@
             {
             wmf_text = next_emf(wmf, US"final");
             if (wmf_text != NULL) fprintf(f, "%s", CS wmf_text);
  -          fclose(wmf);
  +          (void)fclose(wmf);
             }
           else
             {
  @@ -6752,7 +6752,7 @@
           /* 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;
  @@ -6835,7 +6835,7 @@
   /* 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
@@ -6849,7 +6849,7 @@
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)
     {
  @@ -6870,7 +6870,7 @@
   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);


  Index: demime.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/demime.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- demime.c    24 May 2005 08:15:02 -0000    1.5
  +++ demime.c    27 Jun 2005 14:29:43 -0000    1.6
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/demime.c,v 1.5 2005/05/24 08:15:02 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/demime.c,v 1.6 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -60,7 +60,7 @@
     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) */
  @@ -346,7 +346,7 @@
             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 = ';';
  @@ -1078,14 +1078,14 @@
            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;
  @@ -1101,7 +1101,7 @@
             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;
             }
  @@ -1110,7 +1110,7 @@
               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;
  @@ -1152,7 +1152,7 @@
                 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) {
  @@ -1167,7 +1167,7 @@
                 mime_demux(mime_dump_file,info);
               };


  -            fclose(mime_dump_file); mime_dump_file = NULL;
  +            (void)fclose(mime_dump_file); mime_dump_file = NULL;
             };
           }
           else {
  @@ -1218,9 +1218,9 @@


     /* 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);


  Index: dk.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/dk.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- dk.c    24 Jun 2005 08:23:21 -0000    1.4
  +++ dk.c    27 Jun 2005 14:29:43 -0000    1.5
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/dk.c,v 1.4 2005/06/24 08:23:21 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/dk.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -384,8 +384,8 @@
       /* 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;
     }



  Index: exim_dbmbuild.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/exim_dbmbuild.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- exim_dbmbuild.c    14 Jun 2005 10:32:01 -0000    1.3
  +++ exim_dbmbuild.c    27 Jun 2005 14:29:43 -0000    1.4
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/exim_dbmbuild.c,v 1.3 2005/06/14 10:32:01 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/exim_dbmbuild.c,v 1.4 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -207,7 +207,7 @@
     {
     printf("exim_dbmbuild: unable to create %s: %s\n", temp_dbmname,
       strerror(errno));
  -  fclose(f);
  +  (void)fclose(f);
     exit(1);
     }


@@ -404,7 +404,7 @@
TIDYUP:

EXIM_DBCLOSE(d);
-fclose(f);
+(void)fclose(f);

/* If successful, output the number of entries and rename the temporary
files. */

  Index: exim_dbutil.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/exim_dbutil.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- exim_dbutil.c    22 Jun 2005 15:44:38 -0000    1.6
  +++ exim_dbutil.c    27 Jun 2005 14:29:43 -0000    1.7
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/exim_dbutil.c,v 1.6 2005/06/22 15:44:38 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/exim_dbutil.c,v 1.7 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -316,7 +316,7 @@
     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;
     }


  @@ -336,7 +336,7 @@
       ""
       #endif
       );
  -  close(dbblock->lockfd);
  +  (void)close(dbblock->lockfd);
     return NULL;
     }


@@ -361,7 +361,7 @@
dbfn_close(open_db *dbblock)
{
EXIM_DBCLOSE(dbblock->dbptr);
-close(dbblock->lockfd);
+(void)close(dbblock->lockfd);
}



  Index: exim_lock.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/exim_lock.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- exim_lock.c    22 Jun 2005 15:44:38 -0000    1.2
  +++ exim_lock.c    27 Jun 2005 14:29:43 -0000    1.3
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/exim_lock.c,v 1.2 2005/06/22 15:44:38 ph10 Exp $ */
  +/* $Cambridge: exim/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.
  @@ -329,7 +329,7 @@
       /* 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)


  Index: expand.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/expand.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- expand.c    22 Jun 2005 15:44:38 -0000    1.35
  +++ expand.c    27 Jun 2005 14:29:43 -0000    1.36
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/expand.c,v 1.35 2005/06/22 15:44:38 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/expand.c,v 1.36 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -3511,7 +3511,7 @@
           }


         yield = cat_file(f, yield, &size, &ptr, sub_arg[1]);
  -      fclose(f);
  +      (void)fclose(f);
         continue;
         }


  @@ -3604,7 +3604,7 @@
           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. */
  @@ -3701,7 +3701,7 @@


           /* 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.
  @@ -3732,7 +3732,7 @@
           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 */


  Index: filter.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/filter.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- filter.c    4 Jan 2005 10:00:42 -0000    1.3
  +++ filter.c    27 Jun 2005 14:29:43 -0000    1.4
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/filter.c,v 1.3 2005/01/04 10:00:42 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/filter.c,v 1.4 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -1907,7 +1907,7 @@
       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];
  @@ -2500,7 +2500,7 @@
   /* 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;

  Index: filtertest.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/filtertest.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- filtertest.c    6 Apr 2005 14:40:24 -0000    1.5
  +++ filtertest.c    27 Jun 2005 14:29:43 -0000    1.6
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/filtertest.c,v 1.5 2005/04/06 14:40:24 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/filtertest.c,v 1.6 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -181,7 +181,7 @@


filebuf = store_get(statbuf.st_size + 1);
rc = read(fd, filebuf, statbuf.st_size);
-close(fd);
+(void)close(fd);

   if (rc != statbuf.st_size)
     {


  Index: ip.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/ip.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ip.c    4 Jan 2005 10:00:42 -0000    1.2
  +++ ip.c    27 Jun 2005 14:29:43 -0000    1.3
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/ip.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/ip.c,v 1.3 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -249,7 +249,7 @@
   /* 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;
}

  Index: log.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/log.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- log.c    22 Jun 2005 15:44:38 -0000    1.4
  +++ log.c    27 Jun 2005 14:29:43 -0000    1.5
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/log.c,v 1.4 2005/06/22 15:44:38 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/log.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -814,7 +814,7 @@
         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 */
  @@ -830,7 +830,7 @@
         {
         if (Ustat(mainlog_name, &statbuf) < 0 || statbuf.st_ino != mainlog_inode)
           {
  -        close(mainlogfd);
  +        (void)close(mainlogfd);
           mainlogfd = -1;
           mainlog_inode = 0;
           }
  @@ -936,7 +936,7 @@
         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 */
  @@ -953,7 +953,7 @@
         if (Ustat(rejectlog_name, &statbuf) < 0 ||
              statbuf.st_ino != rejectlog_inode)
           {
  -        close(rejectlogfd);
  +        (void)close(rejectlogfd);
           rejectlogfd = -1;
           rejectlog_inode = 0;
           }
  @@ -1031,7 +1031,7 @@
         flags |= LOG_PANIC_DIE;
         }


  -    close(paniclogfd);
  +    (void)close(paniclogfd);
       }


     /* Give up if the DIE flag is set */
  @@ -1051,9 +1051,9 @@
   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;
   }


  Index: malware.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/malware.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- malware.c    6 Jun 2005 18:49:35 -0000    1.9
  +++ malware.c    27 Jun 2005 14:29:43 -0000    1.10
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/malware.c,v 1.9 2005/06/06 18:49:35 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/malware.c,v 1.10 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -69,7 +69,7 @@
     };
     /* 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,
  @@ -189,7 +189,7 @@
         }


         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));
  @@ -205,7 +205,7 @@
         /* 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));
  @@ -213,8 +213,8 @@
         }
         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));
  @@ -228,8 +228,8 @@
             (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;
  @@ -237,8 +237,8 @@


         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);
  @@ -247,25 +247,25 @@


         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 */
  @@ -278,7 +278,7 @@
         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;
  @@ -296,7 +296,7 @@
             (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;
  @@ -305,7 +305,7 @@


       /* 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;
  @@ -313,7 +313,7 @@
       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;
  @@ -336,7 +336,7 @@
         {
           /* 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;
  @@ -345,7 +345,7 @@


           /* 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;
  @@ -393,13 +393,13 @@
         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) {
  @@ -428,7 +428,7 @@
         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;
  @@ -439,7 +439,7 @@


         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;
  @@ -450,7 +450,7 @@


         /* 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;
  @@ -483,7 +483,7 @@


         /* 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;
  @@ -494,13 +494,13 @@


         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;
       }
  @@ -538,7 +538,7 @@
         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));
  @@ -550,7 +550,7 @@
         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));
  @@ -560,7 +560,7 @@
           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;
  @@ -574,7 +574,7 @@
         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));
  @@ -593,7 +593,7 @@
           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;
  @@ -616,7 +616,7 @@
           };
         }
         while (Ustrstr(av_buffer, "OK\tScan ok.") == NULL);
  -      close(sock);
  +      (void)close(sock);
       }
       /* ----------------------------------------------------------------------- */


  @@ -652,7 +652,7 @@
         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;
  @@ -665,7 +665,7 @@


         /* 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;
  @@ -673,7 +673,7 @@


         /* 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;
  @@ -689,21 +689,21 @@


         /* 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;
  @@ -731,7 +731,7 @@
           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;
  @@ -781,7 +781,7 @@
           malware_name = NULL;
         };


  -      close(sock);
  +      (void)close(sock);
       }
       /* ----------------------------------------------------------------------- */


  @@ -900,7 +900,7 @@
             trigger = 1;
         };


  -      fclose(scanner_record);
  +      (void)fclose(scanner_record);
         pclose(scanner_out);
         signal(SIGCHLD,eximsigchld);
         signal(SIGPIPE,eximsigpipe);
  @@ -919,7 +919,7 @@
               pcre_copy_substring(CS linebuffer, ovector, result, 1, CS malware_name_buffer, 255);
             };
           };
  -        fclose(scanner_record);
  +        (void)fclose(scanner_record);
         }
         else {
           /* no virus found */
  @@ -957,7 +957,7 @@
         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;
  @@ -966,24 +966,24 @@
         /* 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') {
  @@ -1068,7 +1068,7 @@
           }


           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));
  @@ -1082,7 +1082,7 @@
             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;
  @@ -1092,7 +1092,7 @@
         /* 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;
  @@ -1134,7 +1134,7 @@
             }


             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));
  @@ -1163,8 +1163,8 @@


       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);
  @@ -1173,26 +1173,26 @@


       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 {
  @@ -1208,7 +1208,7 @@
           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) );
  @@ -1221,7 +1221,7 @@
         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;
  @@ -1239,7 +1239,7 @@
         /* 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,
  @@ -1339,7 +1339,7 @@
         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;


  Index: match.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/match.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- match.c    22 Jun 2005 10:17:23 -0000    1.6
  +++ match.c    27 Jun 2005 14:29:43 -0000    1.7
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/match.c,v 1.6 2005/06/22 10:17:23 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/match.c,v 1.7 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -783,13 +783,13 @@
         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 */
  @@ -802,7 +802,7 @@
            {
             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;
  @@ -814,7 +814,7 @@
       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 */



  Index: mime.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/mime.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- mime.c    4 Apr 2005 10:33:49 -0000    1.7
  +++ mime.c    27 Jun 2005 14:29:43 -0000    1.8
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/mime.c,v 1.7 2005/04/04 10:33:49 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/mime.c,v 1.8 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -384,7 +384,7 @@


     }


- fclose(decode_file);
+ (void)fclose(decode_file);

     clearerr(mime_stream);
     fseek(mime_stream,f_pos,SEEK_SET);
  @@ -418,7 +418,7 @@
           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 = ';';


  Index: moan.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/moan.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- moan.c    4 Jan 2005 10:00:42 -0000    1.2
  +++ moan.c    27 Jun 2005 14:29:43 -0000    1.3
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/moan.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/moan.c,v 1.3 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -248,7 +248,7 @@
   /* 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)
     {
  @@ -437,7 +437,7 @@
       }
     }


-fclose(f);
+(void)fclose(f);
child_close(pid, 0); /* Waits for child to close; no timeout */
}

  @@ -692,7 +692,7 @@
   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;

  Index: os.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/os.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- os.c    4 Jan 2005 10:00:42 -0000    1.2
  +++ os.c    27 Jun 2005 14:29:43 -0000    1.3
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/os.c,v 1.2 2005/01/04 10:00:42 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/os.c,v 1.3 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -696,7 +696,7 @@


/* Close the socket, and return the chain of data blocks. */

-close(vs);
+(void)close(vs);
return yield;
}


  Index: parse.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/parse.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- parse.c    17 Feb 2005 11:58:26 -0000    1.4
  +++ parse.c    27 Jun 2005 14:29:43 -0000    1.5
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/parse.c,v 1.4 2005/02/17 11:58:26 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/parse.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -1475,7 +1475,7 @@
         {
         *error = string_sprintf("failed to stat included file %s: %s",
           filename, strerror(errno));
  -      fclose(f);
  +      (void)fclose(f);
         return FF_INCLUDEFAIL;
         }


  @@ -1502,11 +1502,11 @@
         {
         *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,


  Index: queue.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/queue.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- queue.c    16 Jun 2005 14:10:13 -0000    1.7
  +++ queue.c    27 Jun 2005 14:29:43 -0000    1.8
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/queue.c,v 1.7 2005/06/16 14:10:13 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/queue.c,v 1.8 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -594,7 +594,7 @@
       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
  @@ -627,7 +627,7 @@
       /* 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);


  @@ -873,7 +873,7 @@
           big_buffer[n-1] = 0;
           tree_add_nonrecipient(big_buffer);
           }
  -      fclose(jread);
  +      (void)fclose(jread);
         }
       }


  @@ -1019,9 +1019,9 @@
       }


     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;
     }


  @@ -1064,7 +1064,7 @@
       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;
       }
  @@ -1079,7 +1079,7 @@
   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;
     }
  @@ -1314,7 +1314,7 @@
   /* 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;
}

  Index: rda.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/rda.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- rda.c    16 Jun 2005 14:10:13 -0000    1.7
  +++ rda.c    27 Jun 2005 14:29:43 -0000    1.8
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/rda.c,v 1.7 2005/06/16 14:10:13 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/rda.c,v 1.8 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -302,14 +302,14 @@
   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;
}

@@ -446,8 +446,8 @@
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);
}


  @@ -615,7 +615,7 @@
     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
  @@ -638,8 +638,8 @@
     /* 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 */
  @@ -665,10 +665,10 @@
       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)
         {
  @@ -676,7 +676,7 @@
         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 */
  @@ -684,7 +684,7 @@


     /* 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
  @@ -701,8 +701,8 @@
         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)
  @@ -714,15 +714,15 @@
         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);
  @@ -742,7 +742,7 @@


     /* OK, this process is now done. Must use _exit() and not exit() !! */


  -  close(fd);
  +  (void)close(fd);
     _exit(0);
     }


@@ -755,7 +755,7 @@
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 */

  @@ -940,7 +940,7 @@
     }


FINAL_EXIT:
-close(fd);
+(void)close(fd);
signal(SIGCHLD, oldsignal); /* restore */
return yield;


  Index: readconf.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/readconf.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- readconf.c    21 Jun 2005 14:14:55 -0000    1.10
  +++ readconf.c    27 Jun 2005 14:29:43 -0000    1.11
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/readconf.c,v 1.10 2005/06/21 14:14:55 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/readconf.c,v 1.11 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -603,7 +603,7 @@
       {
       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;
  @@ -3811,7 +3811,7 @@
       }
     }


-fclose(config_file);
+(void)fclose(config_file);
}

/* End of readconf.c */

  Index: receive.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/receive.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- receive.c    22 Jun 2005 15:44:38 -0000    1.19
  +++ receive.c    27 Jun 2005 14:29:43 -0000    1.20
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/receive.c,v 1.19 2005/06/22 15:44:38 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/receive.c,v 1.20 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -303,8 +303,8 @@


/* 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. */

  @@ -865,7 +865,7 @@
       error_rc = EXIT_FAILURE;
     }
   else fprintf(stderr, "exim: %s%s\n", text2, text1);  /* Sic */
  -fclose(f);
  +(void)fclose(f);
   exim_exit(error_rc);
   }


@@ -1078,7 +1078,7 @@
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;
  @@ -2632,7 +2632,7 @@
     {
     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 */
     }


  @@ -2823,7 +2823,7 @@
     if (recipients_count == 0 || error_handling == ERRORS_STDERR)
       {
       Uunlink(spool_name);
  -    fclose(data_file);
  +    (void)fclose(data_file);
       exim_exit(error_rc);
       }
     }
  @@ -3409,7 +3409,7 @@
         {
         log_write(0, LOG_MAIN|LOG_PANIC, "Couldn't fdopen message log %s: %s",
           spool_name, strerror(errno));
  -      close(fd);
  +      (void)close(fd);
         }
       else
         {
  @@ -3419,7 +3419,7 @@
           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);
         }
       }
     }
  @@ -3451,8 +3451,8 @@
   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 */


  Index: regex.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/regex.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- regex.c    24 May 2005 08:15:02 -0000    1.5
  +++ regex.c    27 Jun 2005 14:29:43 -0000    1.6
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/regex.c,v 1.5 2005/05/24 08:15:02 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/regex.c,v 1.6 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -117,7 +117,7 @@
           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);
  @@ -129,7 +129,7 @@
     };


     if (mime_stream == NULL)
  -    fclose(mbox_file);
  +    (void)fclose(mbox_file);
     else {
       clearerr(mime_stream);
       fseek(mime_stream,f_pos,SEEK_SET);
  @@ -232,13 +232,13 @@
                     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;


  Index: smtp_in.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/smtp_in.c,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- smtp_in.c    23 May 2005 16:58:56 -0000    1.19
  +++ smtp_in.c    27 Jun 2005 14:29:43 -0000    1.20
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/smtp_in.c,v 1.19 2005/05/23 16:58:56 fanf2 Exp $ */
  +/* $Cambridge: exim/exim-src/src/smtp_in.c,v 1.20 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -2593,7 +2593,7 @@
       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 */
  @@ -3483,9 +3483,9 @@


       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 */



  Index: smtp_out.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/smtp_out.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- smtp_out.c    17 Feb 2005 11:58:26 -0000    1.4
  +++ smtp_out.c    27 Jun 2005 14:29:43 -0000    1.5
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/smtp_out.c,v 1.4 2005/02/17 11:58:26 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/smtp_out.c,v 1.5 2005/06/27 14:29:43 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -230,7 +230,7 @@
         debug_printf(" (timeout=%s)", readconf_printtime(timeout));
       debug_printf("\n");
       }
  -  close(sock);
  +  (void)close(sock);
     errno = save_errno;
     return -1;
     }


  Index: spam.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/spam.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- spam.c    22 Jun 2005 15:44:38 -0000    1.8
  +++ spam.c    27 Jun 2005 14:29:44 -0000    1.9
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/spam.c,v 1.8 2005/06/22 15:44:38 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/spam.c,v 1.9 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -120,7 +120,7 @@
       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;
       };


  @@ -136,7 +136,7 @@
         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;
         };


  @@ -159,8 +159,8 @@
           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;
         };
       };
  @@ -173,7 +173,7 @@
         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;
       }


  @@ -184,8 +184,8 @@
         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;
       }


@@ -200,11 +200,11 @@

     /* 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;
     };


  @@ -241,8 +241,8 @@
             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
  @@ -251,8 +251,8 @@
         {
             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) {
  @@ -265,12 +265,12 @@
     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);
  @@ -290,12 +290,12 @@
     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",


  Index: spool_in.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/spool_in.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- spool_in.c    22 Jun 2005 15:44:38 -0000    1.11
  +++ spool_in.c    27 Jun 2005 14:29:44 -0000    1.12
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/spool_in.c,v 1.11 2005/06/22 15:44:38 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/spool_in.c,v 1.12 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -89,7 +89,7 @@
     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;


  Index: spool_mbox.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/spool_mbox.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- spool_mbox.c    6 Jun 2005 18:49:35 -0000    1.6
  +++ spool_mbox.c    27 Jun 2005 14:29:44 -0000    1.7
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/spool_mbox.c,v 1.6 2005/06/06 18:49:35 tom Exp $ */
  +/* $Cambridge: exim/exim-src/src/spool_mbox.c,v 1.7 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -70,7 +70,7 @@
           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;
           };
         };
  @@ -84,7 +84,7 @@
           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;
           };
         };
  @@ -98,7 +98,7 @@
           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;
           };
         };
  @@ -117,7 +117,7 @@
         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;
         };


  @@ -134,7 +134,7 @@
           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);
  @@ -142,15 +142,15 @@
           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;
     };


  Index: spool_out.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/spool_out.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- spool_out.c    22 Jun 2005 15:44:38 -0000    1.7
  +++ spool_out.c    27 Jun 2005 14:29:44 -0000    1.8
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/spool_out.c,v 1.7 2005/06/22 15:44:38 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/spool_out.c,v 1.8 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -48,7 +48,7 @@
       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);


  Index: tls-gnu.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/tls-gnu.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- tls-gnu.c    16 Jun 2005 14:10:13 -0000    1.8
  +++ tls-gnu.c    27 Jun 2005 14:29:44 -0000    1.9
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/tls-gnu.c,v 1.8 2005/06/16 14:10:13 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/tls-gnu.c,v 1.9 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -856,8 +856,8 @@


     if (!sigalrm_seen)
       {
  -    fclose(smtp_out);
  -    fclose(smtp_in);
  +    (void)fclose(smtp_out);
  +    (void)fclose(smtp_in);
       }


     return FAIL;


  Index: transport.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/transport.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- transport.c    22 Jun 2005 15:44:38 -0000    1.11
  +++ transport.c    27 Jun 2005 14:29:44 -0000    1.12
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/transport.c,v 1.11 2005/06/22 15:44:38 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/transport.c,v 1.12 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -1090,7 +1090,7 @@


     CLEANUP:
     /* unlink -K file */
  -  close(dk_fd);
  +  (void)close(dk_fd);
     Uunlink(dk_spool_name);
     errno = save_errno;
     return rc;
  @@ -1182,25 +1182,25 @@
   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 */
@@ -1270,8 +1270,8 @@
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)
     {
  @@ -1303,11 +1303,11 @@
       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;
           }
         }
  @@ -1320,7 +1320,7 @@
         }
       }
     }
  -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
@@ -1784,8 +1784,8 @@

     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);


  Index: verify.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/verify.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- verify.c    23 Jun 2005 10:02:13 -0000    1.21
  +++ verify.c    27 Jun 2005 14:29:44 -0000    1.22
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/verify.c,v 1.21 2005/06/23 10:02:13 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/verify.c,v 1.22 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -667,7 +667,7 @@
     /* 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
@@ -1797,7 +1797,7 @@
DEBUG(D_ident) debug_printf("sender_ident = %s\n", sender_ident);

END_OFF:
-close(sock);
+(void)close(sock);
return;
}


  Index: pwcheck.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/auths/pwcheck.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- pwcheck.c    7 Oct 2004 13:10:01 -0000    1.1
  +++ pwcheck.c    27 Jun 2005 14:29:44 -0000    1.2
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/auths/pwcheck.c,v 1.1 2004/10/07 13:10:01 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/auths/pwcheck.c,v 1.2 2005/06/27 14:29:44 ph10 Exp $ */


   /* SASL server API implementation
    * Rob Siemborski
  @@ -137,7 +137,7 @@
          start += n;
        }


  -     close(s);
  +     (void)close(s);


        if (start > 1 && !strncmp(response, "OK", 2)) {
          return PWCHECK_OK;
  @@ -220,14 +220,14 @@
       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;
       }


  @@ -236,25 +236,25 @@
       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);


  Index: cdb.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/lookups/cdb.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- cdb.c    7 Jun 2005 15:20:56 -0000    1.2
  +++ cdb.c    27 Jun 2005 14:29:44 -0000    1.3
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/lookups/cdb.c,v 1.2 2005/06/07 15:20:56 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/lookups/cdb.c,v 1.3 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -431,7 +431,7 @@
    }
   #endif /* HAVE_MMAP */


- close(cdbp->fileno);
+ (void)close(cdbp->fileno);
}

/* End of lookups/cdb.c */

  Index: dbmdb.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/lookups/dbmdb.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- dbmdb.c    4 Jan 2005 10:00:44 -0000    1.2
  +++ dbmdb.c    27 Jun 2005 14:29:44 -0000    1.3
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/lookups/dbmdb.c,v 1.2 2005/01/04 10:00:44 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/lookups/dbmdb.c,v 1.3 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -58,17 +58,17 @@
   #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);
         }


  Index: lsearch.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/lookups/lsearch.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- lsearch.c    11 Jan 2005 15:51:03 -0000    1.3
  +++ lsearch.c    27 Jun 2005 14:29:44 -0000    1.4
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/lookups/lsearch.c,v 1.3 2005/01/11 15:51:03 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/lookups/lsearch.c,v 1.4 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -395,7 +395,7 @@
   void
   lsearch_close(void *handle)
   {
  -fclose((FILE *)handle);
  +(void)fclose((FILE *)handle);
   }


/* End of lookups/lsearch.c */

  Index: iplookup.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/routers/iplookup.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- iplookup.c    4 Jan 2005 10:00:44 -0000    1.2
  +++ iplookup.c    27 Jun 2005 14:29:44 -0000    1.3
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/routers/iplookup.c,v 1.2 2005/01/04 10:00:44 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/routers/iplookup.c,v 1.3 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -251,7 +251,7 @@
       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;
         }


  @@ -259,7 +259,7 @@
       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)?


  Index: queryprogram.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/routers/queryprogram.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- queryprogram.c    28 Apr 2005 13:06:32 -0000    1.4
  +++ queryprogram.c    27 Jun 2005 14:29:44 -0000    1.5
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/routers/queryprogram.c,v 1.4 2005/04/28 13:06:32 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/routers/queryprogram.c,v 1.5 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -278,7 +278,7 @@


/* 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. */
@@ -310,7 +310,7 @@
/* 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. */


  Index: appendfile.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/transports/appendfile.c,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- appendfile.c    22 Jun 2005 15:44:38 -0000    1.9
  +++ appendfile.c    27 Jun 2005 14:29:44 -0000    1.10
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/transports/appendfile.c,v 1.9 2005/06/22 15:44:38 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/transports/appendfile.c,v 1.10 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -602,7 +602,7 @@


     (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)
  @@ -1430,7 +1430,7 @@
       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.*/
  @@ -1622,7 +1622,7 @@
         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)
           {
  @@ -2023,7 +2023,7 @@


           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
  @@ -2039,7 +2039,7 @@
       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 */


  @@ -2468,7 +2468,7 @@
         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;
         }
  @@ -2486,7 +2486,7 @@
             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;
             }
  @@ -2515,7 +2515,7 @@
             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;
             }
  @@ -2732,7 +2732,7 @@
     /* 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 */
  @@ -2755,7 +2755,7 @@
     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 */


  @@ -3130,7 +3130,7 @@
         debug_printf("unlinking MBX lock file %s\n", mbx_lockname);
       Uunlink(mbx_lockname);
       }
  -  close(mbx_lockfd);
  +  (void)close(mbx_lockfd);
     }
   #endif  /* SUPPORT_MBX */



  Index: autoreply.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/transports/autoreply.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- autoreply.c    16 Jun 2005 14:10:14 -0000    1.4
  +++ autoreply.c    27 Jun 2005 14:29:44 -0000    1.5
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/transports/autoreply.c,v 1.4 2005/06/16 14:10:14 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/transports/autoreply.c,v 1.5 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -530,8 +530,8 @@
         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;
       }
  @@ -667,7 +667,7 @@


/* 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
  @@ -702,7 +702,7 @@
       }


     memcpy(cache_time, &now, sizeof(time_t));
  -  write(cache_fd, from, size);
  +  (void)write(cache_fd, from, size);
     }


   /* Update DBM file */
  @@ -798,8 +798,8 @@
           "  %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));
  @@ -807,7 +807,7 @@


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);


  Index: lmtp.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/transports/lmtp.c,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- lmtp.c    17 Feb 2005 11:58:27 -0000    1.4
  +++ lmtp.c    27 Jun 2005 14:29:44 -0000    1.5
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/transports/lmtp.c,v 1.4 2005/02/17 11:58:27 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/transports/lmtp.c,v 1.5 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -740,8 +740,8 @@


(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);


  Index: pipe.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/transports/pipe.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- pipe.c    10 May 2005 11:13:09 -0000    1.6
  +++ pipe.c    27 Jun 2005 14:29:44 -0000    1.7
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/transports/pipe.c,v 1.6 2005/05/10 11:13:09 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/transports/pipe.c,v 1.7 2005/06/27 14:29:44 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -640,8 +640,8 @@
     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;
     }


  @@ -654,7 +654,7 @@
   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)
       {
  @@ -671,11 +671,11 @@
         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

  Index: smtp.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/transports/smtp.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- smtp.c    28 Apr 2005 13:06:32 -0000    1.11
  +++ smtp.c    27 Jun 2005 14:29:45 -0000    1.12
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/transports/smtp.c,v 1.11 2005/04/28 13:06:32 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/transports/smtp.c,v 1.12 2005/06/27 14:29:45 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -1866,7 +1866,7 @@
   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;
  @@ -1919,7 +1919,7 @@
   (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);
   }




  Index: tf_maildir.c
  ===================================================================
  RCS file: /home/cvs/exim/exim-src/src/transports/tf_maildir.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- tf_maildir.c    16 Jun 2005 14:10:14 -0000    1.6
  +++ tf_maildir.c    27 Jun 2005 14:29:45 -0000    1.7
  @@ -1,4 +1,4 @@
  -/* $Cambridge: exim/exim-src/src/transports/tf_maildir.c,v 1.6 2005/06/16 14:10:14 ph10 Exp $ */
  +/* $Cambridge: exim/exim-src/src/transports/tf_maildir.c,v 1.7 2005/06/27 14:29:45 ph10 Exp $ */


   /*************************************************
   *     Exim - an Internet mail transport agent    *
  @@ -498,7 +498,7 @@


     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,
  @@ -516,7 +516,7 @@
       len = Ustrlen(buffer);
       if (write(fd, buffer, len) != len || Urename(tempname, filename) < 0)
         {
  -      close(fd);
  +      (void)close(fd);
         fd = -1;
         }
       }
  @@ -532,7 +532,7 @@
       DEBUG(D_transport) debug_printf("abandoning maildirsize because of "
         "a later subdirectory modification\n");
       (void)Uunlink(filename);
  -    close(fd);
  +    (void)close(fd);
       fd = -1;
       }
     }