server: Avoid -Wshadow warnings
commitd14a9a84c872de4d38682bc8212a7fc6641dd5b1
authorEric Blake <eblake@redhat.com>
Sun, 1 Sep 2019 00:05:27 +0000 (31 19:05 -0500)
committerEric Blake <eblake@redhat.com>
Mon, 2 Sep 2019 10:48:59 +0000 (2 05:48 -0500)
tree05901fc78ea7e7ca2afd9d5f35ed746a64fbf773
parentc0d3f2c794f5e60df565321c070a3ae5cc1ea3b2
server: Avoid -Wshadow warnings

None of these shadowing instances appear to misbehave, but it's
confusing to tell if code intentionally meant for a tighter scope to
override a broader one.  Affected:

global 'readonly' renamed to 'read_only' given the number of other
places that had a local parameter 'readonly'

in main(), 'p' was declared twice with no overlap in use, but 'q'
once; move 'q' to the first declaration

in main(), 'filename' and 'short_name' were declared twice with no
overlap in use; use the first instance, and change the type of
short_name to bool to match is_short_name()

in make_random_fifo(), the local 'unixshadow' is renamed to 'sock' to
no longer shadow the global 'unixshadow'

all callers of send_newstyle_option_reply_exportname() passed the
global 'exportname', no need for a local parameter 'exportname'

in handle_request(), 'buf' for NBD_CMD_CACHE renamed to 'dropbuf' to
be distinct from the function parameter 'buf'

Signed-off-by: Eric Blake <eblake@redhat.com>
server/connections.c
server/internal.h
server/main.c
server/protocol-handshake-newstyle.c
server/protocol.c