diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-09-15 10:56:21 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-09-15 13:09:45 +0200 |
commit | d7ac09520be8f0d3d94df3dd4fd8a6e7404c0174 (patch) | |
tree | 834a60f9b7b22957ff572bcd979737992a0e7ae7 /src/tty-ask-password-agent | |
parent | bd8ea741a424cc730ce88cf62af0046cc33d5249 (diff) | |
download | systemd-d7ac09520be8f0d3d94df3dd4fd8a6e7404c0174.tar.gz |
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/tty-ask-password-agent')
-rw-r--r-- | src/tty-ask-password-agent/tty-ask-password-agent.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tty-ask-password-agent/tty-ask-password-agent.c b/src/tty-ask-password-agent/tty-ask-password-agent.c index 7699bad9e0..839df8d6d2 100644 --- a/src/tty-ask-password-agent/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent/tty-ask-password-agent.c @@ -338,7 +338,8 @@ static int process_and_watch_password_files(bool watch) { _FD_MAX }; - _cleanup_close_ int notify = -1, signal_fd = -1, tty_block_fd = -1; + _unused_ _cleanup_close_ int tty_block_fd = -1; + _cleanup_close_ int notify = -1, signal_fd = -1; struct pollfd pollfd[_FD_MAX]; sigset_t mask; int r; |