summaryrefslogtreecommitdiff
path: root/graphics/xpaint/patches/patch-ad
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/xpaint/patches/patch-ad')
-rw-r--r--graphics/xpaint/patches/patch-ad24
1 files changed, 14 insertions, 10 deletions
diff --git a/graphics/xpaint/patches/patch-ad b/graphics/xpaint/patches/patch-ad
index 68d865369ec..20b7ae5e065 100644
--- a/graphics/xpaint/patches/patch-ad
+++ b/graphics/xpaint/patches/patch-ad
@@ -1,33 +1,37 @@
-$NetBSD: patch-ad,v 1.5 1999/05/09 18:47:22 tron Exp $
+$NetBSD: patch-ad,v 1.6 2002/12/16 09:29:13 tron Exp $
---- readRC.c 1998/02/04 16:36:16 1.1
-+++ readRC.c 1998/02/04 16:41:52
-@@ -64,6 +64,9 @@
+--- readRC.c.orig Sun Nov 24 15:53:30 2002
++++ readRC.c Sun Dec 15 18:58:00 2002
+@@ -75,6 +75,10 @@
static FILE *
openTemp(char **np)
{
+#ifdef __NetBSD__
+ int fd;
++ FILE *f;
+#endif
char *n;
char xx[256];
-@@ -72,11 +75,20 @@
+@@ -83,11 +87,23 @@
strcpy(xx, n);
- strcat(xx, "/XPaintXXXXXXX");
+ strcat(xx, "/XPaint-XXXXXX");
+#ifdef __NetBSD__
+ if ((fd = mkstemp(xx)) < 0)
-+ return (FILE *) NULL;
++ return NULL;
+ tempName[++tempIndex] = XtNewString(xx);
+ if (np != NULL)
-+ *np = tempName[tempIndex];
-+ return fdopen(fd, "w");
++ *np = tempName[tempIndex];
++ f = fdopen(fd, "w");
++ if (f == NULL)
++ (void) close(fd);
++ return f;
+#else
n = mktemp(xx);
tempName[++tempIndex] = XtNewString(n);
if (np != NULL)
- *np = tempName[tempIndex];
+ *np = tempName[tempIndex];
return fopen(tempName[tempIndex], "w");
+#endif
}