Don't return EBADRPC if we have something else.

This commit is contained in:
pk 1996-02-10 22:55:16 +00:00
parent fb81581990
commit b153275d13
1 changed files with 8 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: nfs_boot.c,v 1.21 1996/02/09 21:48:22 christos Exp $ */ /* $NetBSD: nfs_boot.c,v 1.22 1996/02/10 22:55:16 pk Exp $ */
/* /*
* Copyright (c) 1995 Adam Glass, Gordon Ross * Copyright (c) 1995 Adam Glass, Gordon Ross
@ -427,9 +427,13 @@ bp_getfile(bpsin, key, md_sin, serv_name, pathname)
/* client name (hostname) */ /* client name (hostname) */
m = xdr_string_encode(hostname, hostnamelen); m = xdr_string_encode(hostname, hostnamelen);
if (m == NULL)
return (ENOMEM);
/* key name (root or swap) */ /* key name (root or swap) */
m->m_next = xdr_string_encode(key, strlen(key)); m->m_next = xdr_string_encode(key, strlen(key));
if (m->m_next == NULL)
return (ENOMEM);
/* RPC: bootparam/getfile */ /* RPC: bootparam/getfile */
error = krpc_call(bpsin, BOOTPARAM_PROG, BOOTPARAM_VERS, error = krpc_call(bpsin, BOOTPARAM_PROG, BOOTPARAM_VERS,
@ -503,6 +507,8 @@ md_mount(mdsin, path, fhp)
if (error) return error; if (error) return error;
m = xdr_string_encode(path, strlen(path)); m = xdr_string_encode(path, strlen(path));
if (m == NULL)
return (ENOMEM);
/* Do RPC to mountd. */ /* Do RPC to mountd. */
error = krpc_call(mdsin, RPCPROG_MNT, RPCMNT_VER1, error = krpc_call(mdsin, RPCPROG_MNT, RPCMNT_VER1,
@ -518,7 +524,7 @@ md_mount(mdsin, path, fhp)
rdata = mtod(m, struct rdata *); rdata = mtod(m, struct rdata *);
error = fxdr_unsigned(u_int32_t, rdata->errno); error = fxdr_unsigned(u_int32_t, rdata->errno);
if (error) if (error)
goto bad; goto out;
bcopy(rdata->fh, fhp, NFS_FHSIZE); bcopy(rdata->fh, fhp, NFS_FHSIZE);
/* Set port number for NFS use. */ /* Set port number for NFS use. */