summaryrefslogtreecommitdiffstats
path: root/src/udev
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-04-13 00:10:21 +0200
committerLuca Boccassi <luca.boccassi@microsoft.com>2021-04-14 13:25:06 +0200
commitc2b2df604b845b4e1697d0911935e6644323c5a6 (patch)
tree010d290588b55b7ed97f9e3066f56f9a9d08d77d /src/udev
parentmeson: build tests with -Wno-maybe-uninitialized if -O2/-flto are used (diff)
downloadsystemd-c2b2df604b845b4e1697d0911935e6644323c5a6.tar.xz
systemd-c2b2df604b845b4e1697d0911935e6644323c5a6.zip
tree-wide: avoid uninitialized warning on _cleanup_ variables
With some versions of the compiler, the _cleanup_ attr makes it think the variable might be freed/closed when uninitialized, even though it cannot happen. The added cost is small enough to be worth the benefit, and optimized builds will help reduce it even further.
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/scsi_id/scsi_id.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/udev/scsi_id/scsi_id.c b/src/udev/scsi_id/scsi_id.c
index 2f07a2d99f..d9d897c00c 100644
--- a/src/udev/scsi_id/scsi_id.c
+++ b/src/udev/scsi_id/scsi_id.c
@@ -106,7 +106,7 @@ static int get_file_options(const char *vendor, const char *model,
int *argc, char ***newargv) {
_cleanup_free_ char *vendor_in = NULL, *model_in = NULL, *options_in = NULL; /* read in from file */
_cleanup_strv_free_ char **options_argv = NULL;
- _cleanup_fclose_ FILE *f;
+ _cleanup_fclose_ FILE *f = NULL;
int lineno, r;
f = fopen(config_file, "re");