mirror of
https://github.com/transmission/transmission
synced 2024-12-22 07:42:37 +00:00
fix: silence bugprone-unchecked-optional-access warnings (#6990)
* fix: silence bugprone-unchecked-optional-access warnings clang-tidy emits bugprone-unchecked-optional-access warning for `tr_sys_file_lock`. however, this is a false positive: the lines warned about cannot be reached if the optional does not contain a value. adding an `assert` silences these warnings. * Apply suggestions from code review
This commit is contained in:
parent
35ef8cf7a0
commit
0279f37377
1 changed files with 1 additions and 0 deletions
|
@ -986,6 +986,7 @@ bool tr_sys_file_lock([[maybe_unused]] tr_sys_file_t handle, [[maybe_unused]] in
|
|||
|
||||
#endif
|
||||
|
||||
TR_ASSERT(result);
|
||||
if (!*result && errno == EAGAIN)
|
||||
{
|
||||
errno = EWOULDBLOCK;
|
||||
|
|
Loading…
Reference in a new issue