Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: 4.1.0: mkstemp



gcc has taken to complaining about using mktemp() instead of mkstemp().

Index: zshconfig.ac
===================================================================
RCS file: /cvsroot/zsh/zsh/zshconfig.ac,v
retrieving revision 1.5
diff -u -r1.5 zshconfig.ac
--- zshconfig.ac	2001/06/08 18:34:53	1.5
+++ zshconfig.ac	2001/06/15 22:10:13
@@ -915,7 +915,7 @@
 	       readlink faccessx fchdir ftruncate \
 	       fstat lstat lchown \
 	       fseeko ftello \
-	       mkfifo _mktemp \
+	       mkfifo _mktemp mkstemp \
 	       waitpid wait3 \
 	       sigaction sigblock sighold sigrelse sigsetmask sigprocmask \
 	       killpg setpgid setpgrp tcsetpgrp tcgetattr nice \
Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.33
diff -u -r1.33 utils.c
--- Src/utils.c	2001/06/09 18:06:32	1.33
+++ Src/utils.c	2001/06/15 22:10:21
@@ -1101,11 +1101,14 @@
     if (!(s = getsparam("TMPPREFIX")))
 	s = DEFAULT_TMPPREFIX;
  
+#ifdef HAVE_MKSTEMP
+    ret = ((char *) mkstemp(dyncat(unmeta(s), "XXXXXX")));
 #ifdef HAVE__MKTEMP
     /* Zsh uses mktemp() safely, so silence the warnings */
     ret = ((char *) _mktemp(dyncat(unmeta(s), "XXXXXX")));
 #else
     ret = ((char *) mktemp(dyncat(unmeta(s), "XXXXXX")));
+#endif
 #endif
     unqueue_signals();
 

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxx>
Work: pws@xxxxxxx
Web: http://www.pwstephenson.fsnet.co.uk



Messages sorted by: Reverse Date, Date, Thread, Author