*: 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
+2 -4
View File
@@ -118,10 +118,9 @@ int change_uid_gid(const char *user, char **_home) {
if (fd < 0)
return fd;
f = fdopen(fd, "r");
f = take_fdopen(&fd, "r");
if (!f)
return log_oom();
fd = -1;
r = read_line(f, LONG_LINE_MAX, &line);
if (r == 0)
@@ -191,10 +190,9 @@ int change_uid_gid(const char *user, char **_home) {
if (fd < 0)
return fd;
f = fdopen(fd, "r");
f = take_fdopen(&fd, "r");
if (!f)
return log_oom();
fd = -1;
r = read_line(f, LONG_LINE_MAX, &line);
if (r == 0)