*: convert amenable fdopen calls to take_fdopen

Mechanical change to eliminate some cruft by using the
new take_fdopen{_unlocked}() wrappers where trivial.
This commit is contained in:
Vito Caputo
2020-03-31 06:48:03 -07:00
parent 3ebbb6cb39
commit 4fa744a35c
12 changed files with 16 additions and 37 deletions
+1 -3
View File
@@ -48,14 +48,12 @@ int fopen_temporary(const char *path, FILE **ret_f, char **ret_temp_path) {
/* This assumes that returned FILE object is short-lived and used within the same single-threaded
* context and never shared externally, hence locking is not necessary. */
r = fdopen_unlocked(fd, "w", &f);
r = take_fdopen_unlocked(&fd, "w", &f);
if (r < 0) {
(void) unlink(t);
return r;
}
TAKE_FD(fd);
if (ret_f)
*ret_f = TAKE_PTR(f);