$NetBSD: patch-ad,v 1.5 1999/05/09 18:47:22 tron Exp $ --- readRC.c 1998/02/04 16:36:16 1.1 +++ readRC.c 1998/02/04 16:41:52 @@ -64,6 +64,9 @@ static FILE * openTemp(char **np) { +#ifdef __NetBSD__ + int fd; +#endif char *n; char xx[256]; @@ -72,11 +75,20 @@ strcpy(xx, n); strcat(xx, "/XPaintXXXXXXX"); +#ifdef __NetBSD__ + if ((fd = mkstemp(xx)) < 0) + return (FILE *) NULL; + tempName[++tempIndex] = XtNewString(xx); + if (np != NULL) + *np = tempName[tempIndex]; + return fdopen(fd, "w"); +#else n = mktemp(xx); tempName[++tempIndex] = XtNewString(n); if (np != NULL) *np = tempName[tempIndex]; return fopen(tempName[tempIndex], "w"); +#endif } static void