[OpenAFS-devel] [PATCH] fix for macro redefinition warnings

Joe Buehler jbuehler@hekimian.com
Fri, 14 Nov 2003 09:21:08 -0500


It wasn't clear to me whether the cm_config.c line could just
be removed, so I just wrapped it in #ifndef.  It certainly looks
like it SHOULD be removed -- but maybe it's needed for Win9x?

+ cvs diff -u ./src/WINNT/afsd/cklog.c
Index: ./src/WINNT/afsd/cklog.c
===================================================================
RCS file: /cvs/openafs/src/WINNT/afsd/cklog.c,v
retrieving revision 1.2
diff -u -r1.2 cklog.c
--- ./src/WINNT/afsd/cklog.c	4 Nov 2000 10:01:36 -0000	1.2
+++ ./src/WINNT/afsd/cklog.c	14 Nov 2003 14:17:59 -0000
@@ -19,7 +19,7 @@

  #define AFS_KERBEROS_ENV

-#define KABADARGUMENT 1
+#define BAD_ARGUMENT 1
  #define KLOGEXIT(code) exit(code)

  int CommandProc();
@@ -226,7 +226,7 @@
  	if (size <= 0 || size >= sizeof(name)) {
  	    size = sizeof(name) - 1;
  	    if (!GetUserName(name, &size)) {
-		KLOGEXIT( KABADARGUMENT );
+		KLOGEXIT( BAD_ARGUMENT );
  	    }
  	}
      }
@@ -251,7 +251,7 @@
  bad_lifetime:
  	    if (!Silent) fprintf (stderr, "%s: translating '%s' to lifetime failed\n",
  			       rn, life);
-	    return KABADARGUMENT;
+	    return BAD_ARGUMENT;
  	}
  	if (*sp == ':') {
  	    life = sp+1;		/* skip the colon */
@@ -269,7 +269,7 @@
  		fprintf (stderr,
  		"%s: a lifetime of %.2f hours is too long, must be less than %d.\n",
  		rn, (double)lifetime/3600.0, MAXKTCTICKETLIFETIME/3600);
-	    KLOGEXIT( KABADARGUMENT );
+	    KLOGEXIT( BAD_ARGUMENT );
  	}
      } else lifetime = 0;

@@ -289,7 +289,7 @@
  		reason = NULL;
  	    if (reason) {
  		fprintf (stderr, "Unable to login because %s.\n", reason);
-		KLOGEXIT( KABADARGUMENT );
+		KLOGEXIT( BAD_ARGUMENT );
  	    }
  	}
      }
+ cvs diff -u ./src/WINNT/afsd/cm_config.c
Index: ./src/WINNT/afsd/cm_config.c
===================================================================
RCS file: /cvs/openafs/src/WINNT/afsd/cm_config.c,v
retrieving revision 1.7
diff -u -r1.7 cm_config.c
--- ./src/WINNT/afsd/cm_config.c	4 Nov 2002 20:43:50 -0000	1.7
+++ ./src/WINNT/afsd/cm_config.c	14 Nov 2003 14:18:00 -0000
@@ -33,7 +33,9 @@
  #define AFS_THISCELL "ThisCell"
  #define AFS_CELLSERVDB_UNIX "CellServDB"
  #define AFS_CELLSERVDB_NT "afsdcell.ini"
+#ifndef AFSDIR_CLIENT_ETC_DIRPATH
  #define AFSDIR_CLIENT_ETC_DIRPATH "c:/afs"
+#endif
  #if defined(DJGPP) || defined(AFS_WIN95_ENV)
  #define AFS_CELLSERVDB AFS_CELLSERVDB_UNIX
  #ifdef DJGPP

-- 
Joe Buehler