[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[mpop-users] unportable setting of errno



Why does the code have "extern int errno"?

This is not portable and not POSIX. If you want errno, then do
#include <errno.h>
Did you have any example why it was needed? (I didn't read your cvs logs 
to see.)

Here is a patch to remove it.

--- src/conf.c.orig	2005-12-20 16:21:47.000000000 +0000
+++ src/conf.c
@@ -31,7 +31,6 @@
 #include <string.h>
 #include <ctype.h>
 #include <errno.h>
-extern int errno;
 
 #include "gettext.h"
 #include "xalloc.h"

--- src/mpop.c.orig	2005-12-20 16:23:42.000000000 +0000
+++ src/mpop.c
@@ -32,7 +32,6 @@
 #include <string.h>
 #include <ctype.h>
 #include <errno.h>
-extern int errno;
 #include <time.h>
 #include <getopt.h>
 extern char *optarg;

--- src/net.c.orig	2006-08-18 13:55:03.000000000 -0500
+++ src/net.c	2007-01-09 19:38:59.000000000 -0600
@@ -32,7 +32,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
-extern int errno;
 #include <sys/time.h>
 #include <sys/types.h>
 #ifdef W32_NATIVE
@@ -42,7 +41,6 @@
 #else
 # ifndef HAVE_GETADDRINFO
 #  include <netinet/in.h>
-   extern int h_errno;
 # endif
 # include <sys/socket.h>
 # include <arpa/inet.h>

--- src/pop3.c.orig	2006-09-22 20:35:03.000000000 -0500
+++ src/pop3.c	2007-01-09 20:29:22.000000000 -0600
@@ -34,7 +34,6 @@
 #include <strings.h>
 #include <ctype.h>
 #include <errno.h>
-extern int errno;
 #if HAVE_SIGACTION
 # include <signal.h>
 #endif

--- src/uidls.c.orig	2007-01-09 19:42:25.000000000 -0600
+++ src/uidls.c	2007-01-09 19:44:11.000000000 -0600
@@ -30,7 +30,6 @@
 #include <limits.h>
 #include <string.h>
 #include <errno.h>
-extern int errno;
 #include <unistd.h>
 
 #include "gettext.h"
$NetBSD$

--- src/delivery.c.orig	2007-01-09 19:42:52.000000000 -0600
+++ src/delivery.c	2007-01-09 19:43:56.000000000 -0600
@@ -32,7 +32,6 @@
 #include <sys/time.h>
 #include <time.h>
 #include <errno.h>
-extern int errno;
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <unistd.h>
$NetBSD$

--- src/tls.c.orig	2007-01-09 19:43:02.000000000 -0600
+++ src/tls.c	2007-01-09 19:43:49.000000000 -0600
@@ -33,7 +33,6 @@
 #include <limits.h>
 #include <time.h>
 #include <errno.h>
-extern int errno;
 
 #ifdef HAVE_LIBGNUTLS
 # include <gnutls/gnutls.h>
$NetBSD$

--- src/tools.c.orig	2007-01-09 19:52:12.000000000 -0600
+++ src/tools.c	2007-01-09 19:52:28.000000000 -0600
@@ -29,7 +29,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
-extern int errno;
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/stat.h>