delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/12/13/03:06:33

Date: Sun, 13 Dec 1998 10:06:19 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: DJ Delorie <dj AT delorie DOT com>
cc: djgpp-workers AT delorie DOT com
Subject: mkstemp bug
Message-ID: <Pine.SUN.3.91.981213100422.26792D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

I spotted this one while working on the /dev/x/foo testing: mkstemp won't 
replace the template with the name of the file it actually creates.  
Here's a patch:

*** src/libc/compat/stdio/mkstemp.c~0	Sun Jun 28 23:27:22 1998
--- src/libc/compat/stdio/mkstemp.c	Fri Dec 11 15:49:26 1998
*************** mkstemp (char *_template)
*** 22,27 ****
--- 22,29 ----
  
    if (fd == -1)
      errno = ENOENT;
+   else
+     strcpy(_template, tmp_name);
  
    return fd;
  }

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019