Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Mar 2001 10:59:17 -0800 (PST)
From:      tkato@prontomail.ne.jp
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/25616: Update port: graphics/xpaint
Message-ID:  <200103081859.f28IxHl36346@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         25616
>Category:       ports
>Synopsis:       Update port: graphics/xpaint
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 08 11:00:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     KATO Tsuguru
>Release:        4-2-RELEASE i386
>Organization:
>Environment:
>Description:
- Fix usage of mkstemp()

ports/25176 should be superseded by this PR.

>How-To-Repeat:

>Fix:
diff -urN /usr/ports/graphics/xpaint/Makefile graphics/xpaint/Makefile
--- /usr/ports/graphics/xpaint/Makefile	Mon Dec 11 20:25:02 2000
+++ graphics/xpaint/Makefile	Fri Mar  9 03:02:28 2001
@@ -7,6 +7,7 @@
 
 PORTNAME=	xpaint
 PORTVERSION=	2.6.1
+PORTREVISION=	1
 CATEGORIES=	graphics
 MASTER_SITES=	http://home.worldonline.dk/~torsten/xpaint/ \
 		ftp://ftp.win.ne.jp/pub/graphics/
diff -urN /usr/ports/graphics/xpaint/files/patch-aa graphics/xpaint/files/patch-aa
--- /usr/ports/graphics/xpaint/files/patch-aa	Wed Mar 22 00:45:58 2000
+++ graphics/xpaint/files/patch-aa	Fri Mar  9 03:26:17 2001
@@ -1,14 +1,16 @@
---- Local.config.orig	Sun Jun 28 03:43:56 1998
-+++ Local.config	Fri Mar 17 00:32:44 2000
-@@ -142,9 +142,11 @@
+--- Local.config.orig	Sun Sep  3 07:02:09 2000
++++ Local.config	Fri Mar  9 03:26:06 2001
+@@ -141,10 +141,12 @@
+ #endif
  
  #if defined(FreeBSDArchitecture)
- ARCH_DEFINES = -DHAVE_PARAM_H
+-ARCH_DEFINES = -DHAVE_PARAM_H
 -TIFF_INCLUDE = -I/usr/local/include/tiff34
 -TIFF_LIB     = -L/usr/local/lib -ltiff34
 -JPEG_INCLUDE = -I/usr/local/include
 -JPEG_LIB     = -L/usr/local/lib -ljpeg
 -XPM_INCLUDE = -I/usr/X11R6/include/X11
++ARCH_DEFINES = -DHAVE_PARAM_H -DHAVE_MKSTEMP
 +TIFF_INCLUDE = -I${LOCALBASE}/include
 +TIFF_LIB     = -L${LOCALBASE}/lib -Wl,-rpath,${LOCALBASE}/lib -ltiff
 +JPEG_INCLUDE = -I${LOCALBASE}/include
diff -urN /usr/ports/graphics/xpaint/files/patch-ae graphics/xpaint/files/patch-ae
--- /usr/ports/graphics/xpaint/files/patch-ae	Wed Mar 22 00:45:59 2000
+++ graphics/xpaint/files/patch-ae	Fri Mar  9 03:32:01 2001
@@ -1,10 +1,10 @@
---- readRC.c.orig	Tue Jun 25 17:50:39 1996
-+++ readRC.c	Fri Mar 17 01:27:49 2000
+--- readRC.c.orig	Sun Sep  3 07:07:09 2000
++++ readRC.c	Fri Mar  9 03:31:53 2001
 @@ -30,11 +30,13 @@
  #include <unistd.h>
  #endif
  
-+#if !defined(__FreeBSD__) && !defined(__OpenBSD__) && !defined(__NetBSD__)
++#ifndef HAVE_MKSTEMP
  #ifdef __STDC__
  extern char *mktemp(char *);
  #else
@@ -14,32 +14,34 @@
  
  #define RC_FILENAME	".XPaintrc"
  
-@@ -64,6 +66,9 @@
+@@ -64,19 +66,32 @@
  static FILE *
  openTemp(char **np)
  {
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
++#ifdef HAVE_MKSTEMP
 +    int	fd;
 +#endif
      char *n;
      char xx[256];
  
-@@ -72,11 +77,20 @@
+     if ((n = getenv("TMPDIR")) == NULL)
+ 	n = "/tmp";
  
++#ifdef HAVE_MKSTEMP
++    snprintf(xx, 256, "%s/%s", n, "/XPaintXXXXXXX");
++    fd = mkstemp(xx);
++    n = xx;
++#else
      strcpy(xx, n);
      strcat(xx, "/XPaintXXXXXXX");
-+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
-+    if ((fd = mkstemp(xx) < 0))
-+	return (FILE *) NULL;
-+    tempName[++tempIndex] = XtNewString(n);
-+    if (np != NULL)
-+	*np = tempName[tempIndex];
-+    return fdopen(fd, "w");
-+#else
      n = mktemp(xx);
++#endif
      tempName[++tempIndex] = XtNewString(n);
      if (np != NULL)
  	*np = tempName[tempIndex];
++#ifdef HAVE_MKSTEMP
++    return fdopen(fd, "w");
++#else
      return fopen(tempName[tempIndex], "w");
 +#endif
  }

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103081859.f28IxHl36346>