From dacd6cee76a08331b8c8616c5f30f70ee49aa2f9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 29 Jul 2015 20:31:07 +0200 Subject: 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. --- src/libsystemd/sd-device/device-private.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/libsystemd/sd-device') diff --git a/src/libsystemd/sd-device/device-private.c b/src/libsystemd/sd-device/device-private.c index 2e60433246..0ec9667744 100644 --- a/src/libsystemd/sd-device/device-private.c +++ b/src/libsystemd/sd-device/device-private.c @@ -1082,12 +1082,10 @@ int device_update_db(sd_device *device) { return 0; fail: - log_error_errno(r, "failed to create %s file '%s' for '%s'", has_info ? "db" : "empty", - path, device->devpath); - unlink(path); - unlink(path_tmp); + (void) unlink(path); + (void) unlink(path_tmp); - return r; + return log_error_errno(r, "failed to create %s file '%s' for '%s'", has_info ? "db" : "empty", path, device->devpath); } int device_delete_db(sd_device *device) { -- cgit v1.2.3-54-g00ecf