From: Karl Heuer Date: Wed, 8 Apr 1998 07:08:28 +0000 (+0000) Subject: (Fmake_temp_name): Detect error return from mktemp. X-Git-Tag: emacs-20.3~1651 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d8afad26de00051491b9dcad7a2c73b45063733f;p=emacs.git (Fmake_temp_name): Detect error return from mktemp. --- diff --git a/src/fileio.c b/src/fileio.c index fbb6e64f2d1..9b2fe645910 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -797,6 +797,7 @@ which has no existing file.") (prefix) Lisp_Object prefix; { + char *temp; Lisp_Object val; #ifdef MSDOS /* Don't use too many characters of the restricted 8+3 DOS @@ -805,7 +806,10 @@ which has no existing file.") #else val = concat2 (prefix, build_string ("XXXXXX")); #endif - mktemp (XSTRING (val)->data); + temp = mktemp (XSTRING (val)->data); + if (! temp) + error ("No temporary file names based on %s are available", + XSTRING (prefix)->data); #ifdef DOS_NT CORRECT_DIR_SEPS (XSTRING (val)->data); #endif