aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
Diffstat (limited to 'toys')
-rw-r--r--toys/posix/patch.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/posix/patch.c b/toys/posix/patch.c
index 12e4b8c3..bb443484 100644
--- a/toys/posix/patch.c
+++ b/toys/posix/patch.c
@@ -394,7 +394,7 @@ void patch_main(void)
TT.filein = xcreate(name, O_CREAT|O_EXCL|O_RDWR, 0666);
} else {
printf("patching %s\n", name);
- TT.filein = xopen(name, O_RDWR);
+ TT.filein = xopen(name, O_RDONLY);
}
TT.fileout = copy_tempfile(TT.filein, name, &TT.tempname);
TT.linenum = 0;