fetchmail-friends
[Top] [All Lists]

Re: [fetchmail]Problem!! "dup (bad file descriptor)

2002-03-05 00:16:32
Quoting from Andrew S. Golubev's mail on Mon, Mar 04, 2002 at 02:19:11AM +0000:
I see in syslog "fetchmai [pid]: dup(bad file descriptor)................."
Fetchmail runing but not polling.
I reinstall it  but nothing changed :-(
What can I do?

Check your .fetchmailrc. See if you have specified any logfile. If you
have, either remove the line or check if you can create that logfile.

You may try this patch also:

===================================================================
diff -Naur fetchmail-5.9.8.orig/daemon.c fetchmail-5.9.8/daemon.c
--- fetchmail-5.9.8.orig/daemon.c       Mon Jun 25 03:17:22 2001
+++ fetchmail-5.9.8/daemon.c    Tue Mar  5 09:48:42 2002
@@ -234,12 +234,19 @@
   }
 
   if (logfile)
-    fd = open(logfile, O_CREAT|O_WRONLY|O_APPEND, 0666);       /* stdout */
+  {
+    if ((fd = open(logfile, O_CREAT|O_WRONLY|O_APPEND, 0666)) < 0) {   /* 
stdout */
+      report(stderr, "open %s (%s)\n", logfile, strerror(errno));
+      return(PS_IOERR);
+    }
+  }
   else
+  {
     if (dup(fd) < 0) {                         /* stdout */
       report(stderr, "dup (%s)\n", strerror(errno));
       return(PS_IOERR);
     }
+  }
   if (dup(fd) < 0) {                           /* stderr */
     report(stderr, "dup (%s)\n", strerror(errno));
     return(PS_IOERR);
===================================================================

Sunil Shetye.


<Prev in Thread] Current Thread [Next in Thread>