tree-wide: port everything over to fflush_and_check()
Some places invoked fflush() directly with their own manual error checking, let's unify all that by using fflush_and_check(). This also unifies the general error paths of fflush()+rename() file writers.
This commit is contained in:
@@ -382,11 +382,9 @@ int ask_password_agent(
|
||||
if (id)
|
||||
fprintf(f, "Id=%s\n", id);
|
||||
|
||||
fflush(f);
|
||||
|
||||
if (ferror(f)) {
|
||||
log_error_errno(errno, "Failed to write query file: %m");
|
||||
r = -errno;
|
||||
r = fflush_and_check(f);
|
||||
if (r < 0) {
|
||||
log_error_errno(r, "Failed to write query file: %m");
|
||||
goto finish;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user