if ((hashp->fp = mkstemp(namestr)) != -1) { (void)unlink(namestr); #if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)
filename[0] = 0; #if defined(macintosh) strcat(filename, namestr + 1); #else tmpdir = getenv("TMP"); if (!tmpdir) tmpdir = getenv("TMPDIR"); if (!tmpdir) tmpdir = getenv("TEMP"); if (!tmpdir) tmpdir = "."; len = strlen(tmpdir); if (len && len < (sizeof filename - sizeof namestr)) { strcpy(filename, tmpdir); } len = strlen(filename); last = tmpdir[len - 1]; strcat(filename, (last == '/' || last == '\\') ? namestr + 1 : namestr); #endif  #if defined(_WIN32) || defined(_WINDOWS) || defined(XP_OS2) if ((hashp->fp = mkstempflags(filename, _O_BINARY|_O_TEMPORARY)) != -1) { if (hashp->filename) { free(hashp->filename); } hashp->filename = strdup(filename); hashp->is_temp = 1; } #else if ((hashp->fp = mkstemp(filename)) != -1) { (void)unlink(filename); #if !defined(macintosh)
open_temp(HTAB *hashp){#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)	sigset_t set, oset;#endif	static char namestr[] = "_hashXXXXXX";#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)	/* Block signals; make sure file goes away at process exit. */	(void)sigfillset(&set);	(void)sigprocmask(SIG_BLOCK, &set, &oset);#endif	if ((hashp->fp = mkstemp(namestr)) != -1) {		(void)unlink(namestr);#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)		(void)fcntl(hashp->fp, F_SETFD, 1);#endif									  	}#if !defined(_WIN32) && !defined(_WINDOWS) && !defined(macintosh) && !defined(XP_OS2)	(void)sigprocmask(SIG_SETMASK, &oset, (sigset_t *)NULL);#endif	return (hashp->fp != -1 ? 0 : -1);}