*: 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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user