]> Pileus Git - ~andy/fetchmail/blobdiff - driver.c
Merge 'next' branch up to tag 'before-cpp'
[~andy/fetchmail] / driver.c
index 672b34445e55a10702ff7311666b08a2978a4bdf..6d0053253390f89c3bb8d7ce39f24fbaca2c72ec 100644 (file)
--- a/driver.c
+++ b/driver.c
@@ -109,14 +109,8 @@ static void timeout_handler (int signal)
 static int cleanupSockClose (int fd)
 /* close sockets in maximum CLEANUP_TIMEOUT seconds during cleanup */
 {
-    int scerror;
-    SIGHANDLERTYPE alrmsave;
-    alrmsave = set_signal_handler(SIGALRM, null_signal_handler);
-    set_timeout(CLEANUP_TIMEOUT);
-    scerror = SockClose(fd);
-    set_timeout(0);
-    set_signal_handler(SIGALRM, alrmsave);
-    return (scerror);
+    (void)SockTimeout(fd, CLEANUP_TIMEOUT); /* ignore errors */
+    return SockClose(fd);
 }
 
 #ifdef KERBEROS_V5
@@ -425,14 +419,11 @@ static int fetch_messages(int mailserver_socket, struct query *ctl,
         }
        if (msgcode == MSGLEN_OLD)
        {
-               /* To avoid flooding the syslog when using --keep,
-                * report "Skipped message" only when:
-                *  1) --verbose is on, or
-                *  2) fetchmail does not use syslog
-                */
-           if (   (outlevel >= O_VERBOSE) ||
-                  (outlevel > O_SILENT && !run.use_syslog)
-              )
+           /*
+            * To avoid flooding the logs when using --keep, report
+            * skipping for old messages only when --flush is on.
+            */
+           if (outlevel > O_SILENT && ctl->flush)
            {
                report_build(stdout, 
                             GT_("skipping message %s@%s:%d"),
@@ -760,16 +751,11 @@ flagthemail:
        }
        else
        {
-           if (   (outlevel >= O_VERBOSE) ||
-                       /* To avoid flooding the syslog when using --keep,
-                        * report "Skipped message" only when:
-                        *  1) --verbose is on, or
-                        *  2) fetchmail does not use syslog, or
-                        *  3) the message was skipped for some other
-                        *     reason than just being old.
-                        */
-                  (outlevel > O_SILENT && (!run.use_syslog || msgcode != MSGLEN_OLD))
-              )
+           /*
+            * To avoid flooding the logs when using --keep, report
+            * skipping of new messages only.
+            */
+           if (outlevel > O_SILENT && msgcode != MSGLEN_OLD)
            report_complete(stdout, GT_(" not flushed\n"));
 
            /* maybe we mark this message as seen now? */