diff options
author | Greg Kurz <groug@kaod.org> | 2021-04-09 12:06:27 +0200 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2021-05-06 19:47:44 +0100 |
commit | 0adb3aff3932d05b069bd2cb13480f1611cce654 (patch) | |
tree | c9dc7c225ba8613598942f4e18481fb968c15016 /dump | |
parent | d90f154867ec0ec22fd719164b88716e8fd48672 (diff) | |
download | qemu-0adb3aff3932d05b069bd2cb13480f1611cce654.zip qemu-0adb3aff3932d05b069bd2cb13480f1611cce654.tar.gz qemu-0adb3aff3932d05b069bd2cb13480f1611cce654.tar.bz2 |
virtiofsd: Fix side-effect in assert()
It is bad practice to put an expression with a side-effect in
assert() because the side-effect won't happen if the code is
compiled with -DNDEBUG.
Use an intermediate variable. Consolidate this in an macro to
have proper line numbers when the assertion is hit.
virtiofsd: ../../tools/virtiofsd/passthrough_ll.c:2797: lo_getxattr:
Assertion `fchdir_res == 0' failed.
Aborted
2796 /* fchdir should not fail here */
=>2797 FCHDIR_NOFAIL(lo->proc_self_fd);
2798 ret = getxattr(procname, name, value, size);
2799 FCHDIR_NOFAIL(lo->root.fd);
Fixes: bdfd66788349 ("virtiofsd: Fix xattr operations")
Cc: misono.tomohiro@jp.fujitsu.com
Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20210409100627.451573-1-groug@kaod.org>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'dump')
0 files changed, 0 insertions, 0 deletions