]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
text-based mount.nfs: add a few useful parser return codes
authorChuck Lever <chuck.lever@oracle.com>
Wed, 10 Oct 2007 19:06:30 +0000 (15:06 -0400)
committerNeil Brown <neilb@suse.de>
Thu, 11 Oct 2007 01:03:17 +0000 (11:03 +1000)
I forgot to add symbolic return codes for po_rightmost().  Add return codes
for PO_KEY1_RIGHTMOST and PO_KEY2_RIGHTMOST.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Neil Brown <neilb@suse.de>
utils/mount/parse_opt.c
utils/mount/parse_opt.h

index fb4a0e4e800553bb0e949274fb3699a4191bc932..f2531422172844b9d1127671035f58fc482795ab 100644 (file)
@@ -394,9 +394,9 @@ int po_rightmost(struct mount_options *options, char *key1, char *key2)
        if (options) {
                for (option = options->tail; option; option = option->prev) {
                        if (key2 && strcmp(option->keyword, key2) == 0)
-                               return 1;
+                               return PO_KEY2_RIGHTMOST;
                        if (key1 && strcmp(option->keyword, key1) == 0)
-                               return -1;
+                               return PO_KEY1_RIGHTMOST;
                }
        }
 
index 93430d99ce0d03732b177b12f713301ef3968db3..6b9fb5eb914abbae0203ebf04268a1f70d5f31cb 100644 (file)
@@ -31,6 +31,11 @@ enum {
        PO_FOUND = 1,
 };
 
+enum {
+       PO_KEY2_RIGHTMOST = 1,
+       PO_KEY1_RIGHTMOST = -1,
+};
+
 struct mount_options;
 
 struct mount_options * po_split(char *);