diff options
author | Russ Cox <rsc@swtch.com> | 2008-07-10 11:10:10 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-07-10 11:10:10 -0400 |
commit | a58a827f2ae0d989102dc4d8c113b9282ef177b3 (patch) | |
tree | ce7b160c3393224e05a2100615c9fe48d20d2e82 /src/cmd/idiff.c | |
parent | c224dda84efaeb28ce66e59213f3cbfde06735ac (diff) | |
download | plan9port-a58a827f2ae0d989102dc4d8c113b9282ef177b3.tar.gz plan9port-a58a827f2ae0d989102dc4d8c113b9282ef177b3.tar.bz2 plan9port-a58a827f2ae0d989102dc4d8c113b9282ef177b3.zip |
lib9: add mode parameter to opentemp
Diffstat (limited to 'src/cmd/idiff.c')
-rw-r--r-- | src/cmd/idiff.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/cmd/idiff.c b/src/cmd/idiff.c index 234333fa..aaf78be3 100644 --- a/src/cmd/idiff.c +++ b/src/cmd/idiff.c @@ -7,14 +7,11 @@ #include <libc.h> #include <bio.h> -#define opentemp idiffopentemp - int diffbflag; int diffwflag; void copy(Biobuf*, char*, Biobuf*, char*); void idiff(Biobuf*, char*, Biobuf*, char*, Biobuf*, char*, Biobuf*, char*); -int opentemp(char*, int, long); void rundiff(char*, char*, int); void @@ -63,9 +60,9 @@ main(int argc, char **argv) sysfatal("open %s: %r", argv[1]); strcpy(diffout, "/tmp/idiff.XXXXXX"); - fd = opentemp(diffout, ORDWR|ORCLOSE, 0); + fd = opentemp(diffout, ORDWR|ORCLOSE); strcpy(idiffout, "/tmp/idiff.XXXXXX"); - ofd = opentemp(idiffout, ORDWR|ORCLOSE, 0); + ofd = opentemp(idiffout, ORDWR|ORCLOSE); rundiff(argv[0], argv[1], fd); seek(fd, 0, 0); Binit(&bdiff, fd, OREAD); @@ -80,22 +77,6 @@ main(int argc, char **argv) exits(nil); } -int -opentemp(char *template, int mode, long perm) -{ - int fd; - Dir d; - - fd = mkstemp(template); - if(fd < 0) - sysfatal("could not create temporary file"); - nulldir(&d); - d.mode = perm; - dirfwstat(fd, &d); - - return fd; -} - void rundiff(char *arg1, char *arg2, int outfd) { |