diff options
author | Rob Landley <rob@landley.net> | 2013-03-21 23:23:49 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2013-03-21 23:23:49 -0500 |
commit | 5cb3e2683bd8ca23bf8c38e13f3e0d68a642d586 (patch) | |
tree | 23ba7bb1c34e2d9cc3eca05798940c14e2068f58 /toys/posix/patch.c | |
parent | 6f5ef6fc86e11b3aa6cb08a530b1e44ae3d9295c (diff) | |
download | toybox-5cb3e2683bd8ca23bf8c38e13f3e0d68a642d586.tar.gz |
Fix a bug in patch I fixed back in 2010 but forgot to apply here.
Diffstat (limited to 'toys/posix/patch.c')
-rw-r--r-- | toys/posix/patch.c | 2 |
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; |