In a recent note, [EMAIL PROTECTED] said:

> Date: Tue, 9 Apr 2002 23:23:49 -0600 (MDT)
> 
> <SIGH>  OS X substitutes PID for the XXXXXX and attempts to create the
> file.  If creation fails, it substitutes a0, b0, ..., z0, aa, ba, ..., zz
> for the first two digits of PID until it succeeds in creating a unique file.
> Unfortunately, Lynx renames the generated file, so  mkstemp() never needs
> to roll ahead to the next name.  </SIGH>
> 
This patch simply disables mkstemp for __APPLE__.  I suppose the specific
behavior could be checked for in "configure", but I'm not that ambitious.

-- gil
-- 
StorageTek
INFORMATION made POWERFUL
%%% Created Wed Apr 10 00:25:52 MDT 2002 by target lynx.patch. %%%
diff -bru orig/lynx2-8-5/WWW/Library/Implementation/HTUtils.h 
lynx2-8-5/WWW/Library/Implementation/HTUtils.h
--- orig/lynx2-8-5/WWW/Library/Implementation/HTUtils.h Tue Jan  1 18:30:08 2002
+++ lynx2-8-5/WWW/Library/Implementation/HTUtils.h      Wed Apr 10 00:18:06 2002
@@ -14,6 +14,9 @@
 
 #ifdef HAVE_CONFIG_H
 #include <lynx_cfg.h>  /* generated by autoconf 'configure' script */
+#if defined(__APPLE__)
+#undef HAVE_MKSTEMP     /* not unique enough on OS X.  */
+#endif   /* __APPLE__ */
 #include <sys/types.h>
 #include <stdio.h>
 
diff -bru orig/lynx2-8-5/src/LYUtils.c lynx2-8-5/src/LYUtils.c
--- orig/lynx2-8-5/src/LYUtils.c        Tue Jan  1 18:30:08 2002
+++ lynx2-8-5/src/LYUtils.c     Wed Apr 10 00:14:04 2002
@@ -3146,6 +3146,7 @@
     if (strlen(interim) + strlen(suffix) < LY_MAXPATH - 2
     && (fd = mkstemp(interim)) >= 0) {
        sprintf(result, "%s%s", interim, suffix);
+/* FIXME: rename may obliterate an existing file! */
        rename(interim, result);
        chmod(result, HIDE_CHMOD); /* (yes, some mkstemps are broken ;-) */
        close(fd);

Reply via email to