fileio: introduce WRITE_STRING_FILE_NOFOLLOW flag for write_string_file() and friends

This commit is contained in:
Yu Watanabe
2018-11-06 21:24:03 +09:00
parent 57512c893e
commit 835d18ba20
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -160,7 +160,7 @@ int write_string_file_ts(
/* We manually build our own version of fopen(..., "we") that
* works without O_CREAT */
fd = open(fn, O_WRONLY|O_CLOEXEC|O_NOCTTY);
fd = open(fn, O_WRONLY|O_CLOEXEC|O_NOCTTY | ((flags & WRITE_STRING_FILE_NOFOLLOW) ? O_NOFOLLOW : 0));
if (fd < 0) {
r = -errno;
goto fail;