diff options
-rw-r--r-- | src/lib9/opentemp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib9/opentemp.c b/src/lib9/opentemp.c index ff2b3f81..f90bf771 100644 --- a/src/lib9/opentemp.c +++ b/src/lib9/opentemp.c @@ -4,6 +4,12 @@ int opentemp(char *template) { - return mkstemp(template); + int fd; + + fd = mkstemp(template); + if(fd < 0) + return -1; + remove(template); + return fd; } |