Blob Blame History Raw
#!/bin/sh -e
## 14_errno-not-extern.dpatch by James Troup <james@nocrew.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Remove 'extern int errno' which breaks with new glibc (>=
## DP: 2.3.2-ds1-8) and add #include <errno.h> where needed.

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

case "$1" in
       -patch) patch $patch_opts -p1 < $0;;
       -unpatch) patch $patch_opts -p1 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0

@DPATCH@
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/config.c xloadimage-4.1/config.c
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/config.c	2003-10-31 01:50:29.000000000 +0000
+++ xloadimage-4.1/config.c	2003-10-31 01:50:29.000000000 +0000
@@ -26,8 +26,6 @@
 /* SUPPRESS 530 */
 /* SUPPRESS 560 */
 
-extern int errno;
-
 struct filter *Filters = (struct filter *)NULL;
 
 static unsigned int  NumPaths= 0;
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/imagetypes.c xloadimage-4.1/imagetypes.c
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/imagetypes.c	2003-10-31 01:50:29.000000000 +0000
+++ xloadimage-4.1/imagetypes.c	2003-10-31 01:50:29.000000000 +0000
@@ -16,7 +16,6 @@
 
 /* SUPPRESS 560 */
 
-extern int errno;
 extern int findImage(char *name, char *fullname);
 
 /* load a named image
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/img.c xloadimage-4.1/img.c
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/img.c	2003-10-31 01:50:29.000000000 +0000
+++ xloadimage-4.1/img.c	2003-10-31 01:50:43.000000000 +0000
@@ -14,10 +14,9 @@
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
+#include <errno.h>
 #include "image.h"
 
-extern int errno;
-
 #define TRUE  1
 #define FALSE 0
 
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/packtar.c xloadimage-4.1/packtar.c
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/packtar.c	2003-10-31 01:50:29.000000000 +0000
+++ xloadimage-4.1/packtar.c	2003-10-31 01:50:29.000000000 +0000
@@ -11,8 +11,6 @@
 #include <stdio.h>
 #include <errno.h>
 
-extern int errno;
-
 /* poor-man's varargs.  good enough for now.
  */
 int run(a0, a1, a2, a3, a4, a5, a6, a7, a8)
diff -urNad /home/james/debian/packages/xloadimage/xloadimage-4.1/window.c xloadimage-4.1/window.c
--- /home/james/debian/packages/xloadimage/xloadimage-4.1/window.c	2003-10-31 01:50:29.000000000 +0000
+++ xloadimage-4.1/window.c	2003-10-31 01:50:29.000000000 +0000
@@ -33,8 +33,6 @@
 
 /* SUPPRESS 560 */
 
-extern int errno; /* not defined in errno.h on some systems */
-
 static Window    ImageWindow= 0;
 static Window    ViewportWin= 0;
 static Colormap  ImageColormap;