projects
/
libjh.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
778b07f
)
fix for write_file: always add O_WRONLY
author
Jann Horn
<jann@thejh.net>
Sat, 22 Jun 2013 12:46:52 +0000
(14:46 +0200)
committer
Jann Horn
<jann@thejh.net>
Sat, 22 Jun 2013 12:46:52 +0000
(14:46 +0200)
io.c
patch
|
blob
|
history
diff --git
a/io.c
b/io.c
index
6c70b97
..
ac685fb
100644
(file)
--- a/
io.c
+++ b/
io.c
@@
-135,7
+135,7
@@
PUBLIC_FN char *slurp_file(char *path, size_t *len_out, int flags) {
PUBLIC_FN int write_file(char *path, char *buf, ssize_t len, int open_flags) {
if (len == -1) len = strlen(buf);
PUBLIC_FN int write_file(char *path, char *buf, ssize_t len, int open_flags) {
if (len == -1) len = strlen(buf);
- int fd = open(path, open_flags|O_CLOEXEC, 0777);
+ int fd = open(path, open_flags|O_CLOEXEC
|O_WRONLY
, 0777);
if (fd == -1) return 1;
ssize_t write_res = write_nointr(fd, buf, len, NULL);
int write_errno = errno;
if (fd == -1) return 1;
ssize_t write_res = write_nointr(fd, buf, len, NULL);
int write_errno = errno;