summaryrefslogtreecommitdiffstats
path: root/src/udev
diff options
context:
space:
mode:
authorFrantisek Sumsal <frantisek@sumsal.cz>2021-09-15 10:56:21 +0200
committerFrantisek Sumsal <frantisek@sumsal.cz>2021-09-15 13:09:45 +0200
commitd7ac09520be8f0d3d94df3dd4fd8a6e7404c0174 (patch)
tree834a60f9b7b22957ff572bcd979737992a0e7ae7 /src/udev
parentci: build with clang-13 (diff)
downloadsystemd-d7ac09520be8f0d3d94df3dd4fd8a6e7404c0174.tar.xz
systemd-d7ac09520be8f0d3d94df3dd4fd8a6e7404c0174.zip
tree-wide: mark set-but-not-used variables as unused to make LLVM happy
LLVM 13 introduced `-Wunused-but-set-variable` diagnostic flag, which trips over some intentionally set-but-not-used variables or variables attached to cleanup handlers with side effects (`_cleanup_umask_`, `_cleanup_(notify_on_cleanup)`, `_cleanup_(restore_sigsetp)`, etc.): ``` ../src/basic/process-util.c:1257:46: error: variable 'saved_ssp' set but not used [-Werror,-Wunused-but-set-variable] _cleanup_(restore_sigsetp) sigset_t *saved_ssp = NULL; ^ 1 error generated. ```
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udevd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index df720898ea..6df580d629 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -1136,7 +1136,8 @@ static int on_ctrl_msg(UdevCtrl *uctrl, UdevCtrlMessageType type, const UdevCtrl
manager_reload(manager);
break;
case UDEV_CTRL_SET_ENV: {
- _cleanup_free_ char *key = NULL, *val = NULL, *old_key = NULL, *old_val = NULL;
+ _unused_ _cleanup_free_ char *old_val = NULL;
+ _cleanup_free_ char *key = NULL, *val = NULL, *old_key = NULL;
const char *eq;
eq = strchr(value->buf, '=');