From d8afad26de00051491b9dcad7a2c73b45063733f Mon Sep 17 00:00:00 2001 From: Karl Heuer Date: Wed, 8 Apr 1998 07:08:28 +0000 Subject: [PATCH] (Fmake_temp_name): Detect error return from mktemp. --- src/fileio.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.39.2