summaryrefslogtreecommitdiff
path: root/src/coredump/coredump.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-04-12 23:10:21 +0100
committerLuca Boccassi <luca.boccassi@microsoft.com>2021-04-14 12:25:06 +0100
commitc2b2df604b845b4e1697d0911935e6644323c5a6 (patch)
tree010d290588b55b7ed97f9e3066f56f9a9d08d77d /src/coredump/coredump.c
parentbe084c0dd1f1a06320e507c0e6a9de23b37556e1 (diff)
downloadsystemd-c2b2df604b845b4e1697d0911935e6644323c5a6.tar.gz
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/coredump/coredump.c')
-rw-r--r--src/coredump/coredump.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
index b6cc7e3887..62467d4cf9 100644
--- a/src/coredump/coredump.c
+++ b/src/coredump/coredump.c
@@ -588,7 +588,7 @@ static int compose_open_fds(pid_t pid, char **open_fds) {
static int get_process_ns(pid_t pid, const char *namespace, ino_t *ns) {
const char *p;
struct stat stbuf;
- _cleanup_close_ int proc_ns_dir_fd;
+ _cleanup_close_ int proc_ns_dir_fd = -1;
p = procfs_file_alloca(pid, "ns");