[rtems-libbsd commit] Make the license message viewable with a verbose option.

Chris Johns chrisj at rtems.org
Wed Jul 6 00:57:04 UTC 2016


Module:    rtems-libbsd
Branch:    master
Commit:    761ae78e0528ac5c1f46df11e9bea453ac6c82dd
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=761ae78e0528ac5c1f46df11e9bea453ac6c82dd

Author:    Chris Johns <chrisj at rtems.org>
Date:      Thu Jun 30 13:32:29 2016 +1000

Make the license message viewable with a verbose option.

The license details can be viewed if you mount with a -v option:

 # mount -i nfs -o "-v" 1.2.3.4:/mnt /mnt

---

 rtemsbsd/include/librtemsNfs.h |  4 ++--
 rtemsbsd/nfsclient/nfs.c       | 23 +++++++++++++----------
 rtemsbsd/nfsclient/rpcio.c     | 10 ++++++----
 3 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/rtemsbsd/include/librtemsNfs.h b/rtemsbsd/include/librtemsNfs.h
index 530eee2..01aac38 100644
--- a/rtemsbsd/include/librtemsNfs.h
+++ b/rtemsbsd/include/librtemsNfs.h
@@ -132,7 +132,7 @@ rpcSetXIDs(uint32_t xid);
  * @retval 0 on success, -1 on failure
  */
 int
-rpcUdpInit(void);
+rpcUdpInit(bool verbose);
 
 /**
  * @brief RPC cleanup and stop.
@@ -167,7 +167,7 @@ rpcUdpCleanup(void);
  * @retval -1 An error occurred.  The errno is set to indicate the error.
  */
 int
-nfsInit(int smallPoolDepth, int bigPoolDepth);
+nfsInit(int smallPoolDepth, int bigPoolDepth, bool verbose);
 
 /**
  * @brief Driver cleanup code.
diff --git a/rtemsbsd/nfsclient/nfs.c b/rtemsbsd/nfsclient/nfs.c
index fae79b8..b68bab3 100644
--- a/rtemsbsd/nfsclient/nfs.c
+++ b/rtemsbsd/nfsclient/nfs.c
@@ -1007,7 +1007,7 @@ NfsNode rval = nfsNodeCreate(node->nfs, 0);
  * 			on the fly).
  */
 int
-nfsInit(int smallPoolDepth, int bigPoolDepth)
+nfsInit(int smallPoolDepth, int bigPoolDepth, bool verbose)
 {
 static int initialised = 0;
 entry	dummy;
@@ -1018,10 +1018,11 @@ rtems_status_code status;
 
 	initialised = 1;
 
-	fprintf(stderr,
-          "RTEMS-NFS $Release$, "                       \
-          "Till Straumann, Stanford/SLAC/SSRL 2002, " \
-          "See LICENSE file for licensing info.\n");
+	if (verbose)
+		fprintf(stderr,
+				"RTEMS-NFS, "							\
+				"Till Straumann, Stanford/SLAC/SSRL 2002, " \
+				"See LICENSE for licensing info.\n");
 
 	/* Get a major number */
 
@@ -1807,13 +1808,15 @@ NfsNode				rootNode  = 0;
 RpcUdpServer		nfsServer = 0;
 int					e         = -1;
 char				*path     = mt_entry->dev;
+const char          *options = (const char*) data;
+bool                verbose = strstr(options, "-v") != NULL;
 
-  if (rpcUdpInit () < 0) {
-    fprintf (stderr, "error: initialising RPC\n");
-    return -1;
-  }
+	if (rpcUdpInit (verbose) < 0) {
+		fprintf (stderr, "error: initialising RPC\n");
+		return -1;
+	}
 
-	if (nfsInit(0, 0) != 0) {
+	if (nfsInit(0, 0, verbose) != 0) {
 		fprintf (stderr, "error: initialising NFS\n");
 		return -1;
 	};
diff --git a/rtemsbsd/nfsclient/rpcio.c b/rtemsbsd/nfsclient/rpcio.c
index 6bc1aad..cd04de3 100644
--- a/rtemsbsd/nfsclient/rpcio.c
+++ b/rtemsbsd/nfsclient/rpcio.c
@@ -954,7 +954,7 @@ rpcSetXIDs(uint32_t xid)
 }
 
 int
-rpcUdpInit(void)
+rpcUdpInit(bool verbose)
 {
 int			s;
 rtems_status_code	status;
@@ -962,9 +962,11 @@ int			noblock = 1;
 struct kevent		change;
 
 	if (ourSock < 0) {
-    fprintf(stderr,"RTEMS-RPCIOD $Release$, " \
-            "Till Straumann, Stanford/SLAC/SSRL 2002, " \
-            "See LICENSE file for licensing info.\n");
+
+		if (verbose)
+			fprintf(stderr,"RTEMS-RPCIOD, "				\
+					"Till Straumann, Stanford/SLAC/SSRL 2002, " \
+					"See LICENSE for licensing info.\n");
 
 		ourSock=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
 		if (ourSock>=0) {




More information about the vc mailing list