lib9: revert unintended changes to opentemp

This commit is contained in:
Russ Cox 2008-07-09 11:53:31 -04:00
parent 0a40aeedbf
commit e960e21be1

View file

@ -2,20 +2,14 @@
#include <libc.h>
int
opentemp(char *template, int mode)
opentemp(char *template)
{
int fd, fd1;
int fd;
fd = mkstemp(template);
if(fd < 0)
return -1;
/* reopen for mode */
fd1 = open(template, mode);
if(fd1 < 0){
close(fd);
remove(template);
return -1;
}
close(fd);
return fd1;
remove(template);
return fd;
}