[rtems-libbsd commit] rtemsbsd/nfsclient: Fix the error code return value

Chris Johns chrisj at rtems.org
Thu Oct 21 01:58:41 UTC 2021


Module:    rtems-libbsd
Branch:    6-freebsd-12
Commit:    87a5b455642f5a23e4f0cf619c43bc9b07bb1afc
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=87a5b455642f5a23e4f0cf619c43bc9b07bb1afc

Author:    Chris Johns <chrisj at rtems.org>
Date:      Wed Oct 20 14:13:44 2021 +1100

rtemsbsd/nfsclient: Fix the error code return value

---

 rtemsbsd/fs/nfsclient/nfs.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/rtemsbsd/fs/nfsclient/nfs.c b/rtemsbsd/fs/nfsclient/nfs.c
index fe8d841..ffbf7f4 100644
--- a/rtemsbsd/fs/nfsclient/nfs.c
+++ b/rtemsbsd/fs/nfsclient/nfs.c
@@ -963,16 +963,16 @@ rtems_nfs_initialize(
 			tryret = nfs_tryproto(ai, &args);
 			if (tryret == TRYRET_SUCCESS) {
 				error = nfs_trymount(mt_entry, ai, &args, fspath, data);
-			if (RTEMS_DEBUG)
-					printf("nfs: mount: (%d) %s\n", error, strerror(error));
+				if (RTEMS_DEBUG)
+						printf("nfs: mount: (%d) %s\n", error, strerror(error));
 				break;
 			} else {
 				error = EIO;
 				if (RTEMS_DEBUG)
 					printf("nfs: mount: %s\n", args.errstr);
+			}
 		}
 	}
-	}
 
 	freeaddrinfo(args.ai_nfs);
 
@@ -984,6 +984,7 @@ out:
 		if (fspath != NULL) {
 			rtems_bsd_rootfs_rmdir(fspath);
 		}
+	  rtems_set_errno_and_return_minus_one(error);
 	}
-	return error;
+	return 0;
 }



More information about the vc mailing list