From: Matthias A. <mat...@gm...> - 2005-07-02 01:02:28
|
Nico Golde <ni...@ng...> writes: > please include the attached patch by Andreas Krennmair. > diff -Nurb fetchmail-6.2.5/interface.c fetchmail.new/interface.c > --- fetchmail-6.2.5/interface.c 2003-07-17 17:27:29.000000000 +0200 > +++ fetchmail.new/interface.c 2005-07-01 13:42:33.000000000 +0200 > @@ -25,6 +25,7 @@ > #if defined(HAVE_UNISTD_H) > #include <unistd.h> > #endif > +#include <sys/utsname.h> > #include <sys/ioctl.h> > #include <sys/socket.h> > #include <netinet/in.h> > @@ -75,22 +76,22 @@ > void interface_init(void) > /* figure out which /proc/dev/net format to use */ > { > - FILE *fp = popen("uname -r", "r"); /* still wins if /proc is out */ > + struct utsname ut; > + int rc = uname(&ut); ... > - if (fscanf(fp, "%d.%d.%*d", &major, &minor) >= 2 > + if (sscanf(ut.release, "%d.%d.%*d", &major, &minor) >= 2 > && major >= 2 && minor >= 2) This is bogus. How about major == 3 and minor == 0? It'll assume the old 2.0 format. A similar patch to get rid of the popen() by Paul Slootman has been merged in November 2004, see <http://decoy.wox.org/svn/fetchmail/trunk/interface.c> for the current state. -- Matthias Andree |