XFS SoftAssert when doing hard links in AFS?

Christopher Allen Wing wingc at engin.umich.edu
Sat Mar 11 10:35:11 CET 2000


Love:

> It should be a problem related to the lockfile. I have seen it on my users
> and my computer too, so its not related to smp I would guess.

Well, I'll get xfs debugging output the next time that it happens.

> > klog needs 2 things from getarg:
> 
> I don't like messing around any more with getarg, but it almost works so it
> might have to do for now (with your patch).


Okay, here is my proposal then:



diff -uNr arla-20000215.orig/lib/roken/getarg.c arla-20000215/lib/roken/getarg.c
--- arla-20000215.orig/lib/roken/getarg.c	Fri Oct 29 17:06:45 1999
+++ arla-20000215/lib/roken/getarg.c	Fri Feb 25 16:30:09 2000
@@ -274,6 +274,7 @@
 	return 0;
     }
     case arg_string:
+    case arg_generic_string:
     {
 	*(char**)arg->value = optarg;
 	return 0;
@@ -321,7 +322,9 @@
     char *optarg = NULL;
     int negate = 0;
     int partial_match = 0;
+    int do_generic=0;
     struct getargs *partial = NULL;
+    struct getargs *generic_arg = NULL;
     struct getargs *current = NULL;
     struct getargs *arg;
     int argv_len;
@@ -344,6 +347,20 @@
 	argv_len = p - q;
 
     for (arg = args; arg->type ; arg++) {
+	/* parse a generic argument if it has not already been filled */
+	if ( (!do_generic) && (arg->type == arg_generic_string) ) {
+	    char *hole = (char *)arg->value;
+
+	    if ( (hole) && (*hole == '\0') )
+		do_generic = 1;
+	}
+
+	if(do_generic) {
+	    generic_arg = arg;
+	    optarg = *(argv);
+	    *next = 0;
+	}
+
 	if(arg->long_name) {
 	    int len = strlen(arg->long_name);
 	    char *p = q;
@@ -395,7 +412,10 @@
 	}
     }
     if (current == NULL) {
-	if (partial_match == 1)
+	/* Match a generic argument preferentially over a partial match */
+	if (generic_arg)
+	    current = generic_arg;
+	else if (partial_match == 1)
 	    current = partial;
 	else
 	    return ARG_ERR_NO_MATCH;
@@ -419,7 +439,11 @@
     srand (time(NULL));
     (*optind)++;
     for(i = *optind; i < argc; i++) {
-	if(argv[i][0] != '-' && swcount != -1) {
+	if(argv[i][0] != '-' && swcount != -1 && (args[swcount].mandatoryp == arg_mandatory) ) {
+	    /* the mandatory junk up there is to prevent getarg() from
+	       automatically matching options even when not specified with
+	       their flagged name
+	    */
 	    if (!(style & ARG_SWITCHLESS))
 		break;
 	    j = 0;
diff -uNr arla-20000215.orig/lib/roken/getarg.h arla-20000215/lib/roken/getarg.h
--- arla-20000215.orig/lib/roken/getarg.h	Mon Dec  7 23:00:08 1998
+++ arla-20000215/lib/roken/getarg.h	Fri Feb 25 16:22:46 2000
@@ -58,7 +58,7 @@
     char short_name;
     enum { arg_end = 0, arg_integer, arg_string, 
 	   arg_flag, arg_negative_flag, arg_strings,
-           arg_generic } type;
+           arg_generic_string } type;
     void *value;
     const char *help;
     const char *arg_help;







More information about the Arla-drinkers mailing list