Removed a couple Wmissing-prototypes warnings in the mountd code.
Once the parse_fsid() function was made static, the compiler
detected execution paths through it that did not initialize some
fields in *parsed.
[ I'm pretty sure these problems are currently harmless, since each
path is taken depending on the value of the .fsidtype field. Each
path accesses only the fields in *parsed that it cares about. ]
This is because parsed_fsid isn't a union type. parse_fsid() leaves
uninitialized fields that are not used by a particular fsidtype. To
prevent an accidental dereference of stack garbage (.fhuuid being an
example of a pointer that is left uninitialized sometimes), have
parse_fsid() defensively pre-initialize *parsed to zero.
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
char *fhuuid;
};
-int parse_fsid(int fsidtype, int fsidlen, char *fsid, struct parsed_fsid *parsed)
+static int parse_fsid(int fsidtype, int fsidlen, char *fsid,
+ struct parsed_fsid *parsed)
{
unsigned int dev;
unsigned long long inode64;
+ memset(parsed, 0, sizeof(*parsed));
parsed->fsidtype = fsidtype;
switch(fsidtype) {
case FSID_DEV: /* 4 bytes: 2 major, 2 minor, 4 inode */
return false;
}
-struct addrinfo *lookup_client_addr(char *dom)
+static struct addrinfo *lookup_client_addr(char *dom)
{
struct addrinfo *ret;
struct addrinfo *tmp;