$OpenBSD: patch-tools_fax2ps_c,v 1.6 2010/06/30 17:10:08 naddy Exp $
--- tools/fax2ps.c.orig	Thu Apr 20 14:36:23 2006
+++ tools/fax2ps.c	Sun Oct 11 15:42:29 2009
@@ -377,11 +377,12 @@ main(int argc, char** argv)
 	int n;
 	FILE* fd;
 	char buf[16*1024];
+	char temp[22];
 
-	fd = tmpfile();
+	strlcpy(temp, "/tmp/fax2psXXXXXXXXXX", sizeof(temp));
+	fd = fdopen(mkstemp(temp), "w+");
 	if (fd == NULL) {
-	    fprintf(stderr, "Could not create temporary file, exiting.\n");
-	    fclose(fd);
+	    fprintf(stderr, "Could not create temporary file \"%s\".\n", temp);
 	    exit(-2);
 	}
 #if defined(HAVE_SETMODE) && defined(O_BINARY)
