aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/idiff.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/idiff.c')
-rw-r--r--src/cmd/idiff.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/idiff.c b/src/cmd/idiff.c
index c3f207fe..1dc49cff 100644
--- a/src/cmd/idiff.c
+++ b/src/cmd/idiff.c
@@ -82,11 +82,14 @@ int
opentemp(char *template, int mode, long perm)
{
int fd;
+ Dir d;
fd = mkstemp(template);
if(fd < 0)
sysfatal("could not create temporary file");
- fchmod(fd, perm);
+ nulldir(&d);
+ d.mode = perm;
+ dirfwstat(fd, &d);
return fd;
}