diff options
author | Vivek Goyal <vgoyal@redhat.com> | 2021-02-08 17:40:23 -0500 |
---|---|---|
committer | Dr. David Alan Gilbert <dgilbert@redhat.com> | 2021-02-16 17:03:09 +0000 |
commit | 1e08f164e9fdc9528ad6990012301b9a04b0bc90 (patch) | |
tree | 03c972153ca2c3881af524ddcff16bd0476ddbe7 /util/unicode.c | |
parent | a65963efa3a8533e8c9fc62e899147612d913058 (diff) | |
download | qemu-1e08f164e9fdc9528ad6990012301b9a04b0bc90.zip qemu-1e08f164e9fdc9528ad6990012301b9a04b0bc90.tar.gz qemu-1e08f164e9fdc9528ad6990012301b9a04b0bc90.tar.bz2 |
virtiofsd: Save error code early at the failure callsite
Change error code handling slightly in lo_setattr(). Right now we seem
to jump to out_err and assume that "errno" is valid and use that to
send reply.
But if caller has to do some other operations before jumping to out_err,
then it does the dance of first saving errno to saverr and the restore
errno before jumping to out_err. This makes it more confusing.
I am about to make more changes where caller will have to do some
work after error before jumping to out_err. I found it easier to
change the convention a bit. That is caller saves error in "saverr"
before jumping to out_err. And out_err uses "saverr" to send error
back and does not rely on "errno" having actual error.
v3: Resolved conflicts in lo_setattr() due to lo_inode_open() changes.
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Message-Id: <20210208224024.43555-2-vgoyal@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'util/unicode.c')
0 files changed, 0 insertions, 0 deletions