rx: Reorganize LWP rxi_Sendmsg to use 'goto error' 22/14422/2
authorAndrew Deason <adeason@sinenomine.net>
Mon, 2 Nov 2020 19:11:49 +0000 (13:11 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 11 Dec 2020 04:48:06 +0000 (23:48 -0500)
commit7239565b0fea8504deebc5bd43c4fa1ea80fcb17
tree031e38fff614f40285c9d2808ae336f2af608039
parent01c10fe8a98ffabd5cf9ec27f4b51f7011c3f1af
rx: Reorganize LWP rxi_Sendmsg to use 'goto error'

Our LWP version of rxi_Sendmsg can allocate an fd_set, but we don't
free the fd_set if sendmsg() returns certain errors afterwards.

To make sure we go through the same cleanup code for the different
possible error code paths, reorganize the function to go through a
'goto error'-style destructor. This also makes our return codes a bit
more consistent; we should always return -errno now for errors.

Change-Id: I5eaeb7f4ea1d76acc3bd9c52dc258f53f59f631e
Reviewed-on: https://gerrit.openafs.org/14422
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/rx/rx_lwp.c