Commit deb9c15
notes-merge: use O_EXCL to avoid overwriting existing files
Use the open(2) flag O_EXCL to ensure the file doesn't already exist
instead of (racily) calling stat(2) through file_exists(). While at it
switch to xopen() to reduce code duplication and get more consistent
error messages.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 0b65a8d commit deb9c15
1 file changed
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
302 | | - | |
303 | 301 | | |
304 | | - | |
305 | | - | |
306 | | - | |
| 302 | + | |
307 | 303 | | |
308 | 304 | | |
309 | 305 | | |
| |||
0 commit comments