]> Pileus Git - ~andy/fetchmail/commitdiff
No longer stat rcfile if it's called -.
authorMatthias Andree <matthias.andree@gmx.de>
Mon, 12 Jun 2006 11:45:05 +0000 (11:45 -0000)
committerMatthias Andree <matthias.andree@gmx.de>
Mon, 12 Jun 2006 11:45:05 +0000 (11:45 -0000)
Fixes BerliOS bug #7858.

svn path=/branches/BRANCH_6-3/; revision=4853

NEWS
fetchmail.c

diff --git a/NEWS b/NEWS
index f35a730b76caacbd1aa9a20d206014dbaf7c575a..10237e5f699c99f59eaa9c9c6be45e152934920f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -82,6 +82,9 @@ fetchmail 6.3.5 (not yet released):
   - also enter IDLE loop when messages are present on the server.
 * Fix --flush description in the manual page, fetchmail does not mark messages
   seen unless it has successfully delivered them. Suggested by Frederic Marchal.
+* Fetchmail no longer attempts to stat the "-" file in daemon mode -- this is a
+  special name to read the RC file from stdin, and cannot always be re-read
+  anyways. BerliOS bug #7858.
 
 # CHANGES:
 * Rename all fetchmail-internal lock_* functions to fm_lock_*. Obsoletes
index dd082f2f2698a8a2e9af91ee695d8fef162d6cfa..1c895a0a3cc7c36a63bfe0953a4157b7772bee88 100644 (file)
@@ -597,8 +597,9 @@ int main(int argc, char **argv)
         */
        struct stat     rcstat;
 
-       if (stat(rcfile, &rcstat) == -1)
-       {
+       if (strcmp(rcfile, "-") == 0) {
+           /* do nothing */
+       } else if (stat(rcfile, &rcstat) == -1) {
            if (errno != ENOENT)
                report(stderr, 
                       GT_("couldn't time-check %s (error %d)\n"),
@@ -986,7 +987,7 @@ static int load_params(int argc, char **argv, int optind)
 
     /* note the parse time, so we can pick up on modifications */
     parsetime = 0;     /* foil compiler warnings */
-    if (stat(rcfile, &rcstat) != -1)
+    if (strcmp(rcfile, "-") == 0 || stat(rcfile, &rcstat) != -1)
        parsetime = rcstat.st_mtime;
     else if (errno != ENOENT)
        report(stderr, GT_("couldn't time-check the run-control file\n"));