diff options
author | Russ Cox <rsc@swtch.com> | 2008-07-09 11:53:31 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-07-09 11:53:31 -0400 |
commit | e960e21be1b197cfde3a7601a2120a93aa309a12 (patch) | |
tree | 09bbaf7091a399b43bce364975834867426e7804 /src/lib9 | |
parent | 0a40aeedbfc4713f4d8f20031e00a494c647bc9e (diff) | |
download | plan9port-e960e21be1b197cfde3a7601a2120a93aa309a12.tar.gz plan9port-e960e21be1b197cfde3a7601a2120a93aa309a12.tar.bz2 plan9port-e960e21be1b197cfde3a7601a2120a93aa309a12.zip |
lib9: revert unintended changes to opentemp
Diffstat (limited to 'src/lib9')
-rw-r--r-- | src/lib9/opentemp.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/lib9/opentemp.c b/src/lib9/opentemp.c index 0af154de..f90bf771 100644 --- a/src/lib9/opentemp.c +++ b/src/lib9/opentemp.c @@ -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; } + |