[OpenAFS-devel] linux 2.6.11.4 and bogus 'setting clock back'

Harald Barth haba@pdc.kth.se
Thu, 17 Mar 2005 13:15:27 +0100 (MET)


> It's not trivial due to the awkward way options are handled in afsd.  But
> send me a patch and we'll consider it.

What did I miss? See below.

Harald.

habarber:afsd$ diff -u afsd.c.orig afsd.c
--- afsd.c.orig 2004-07-29 00:47:58.000000000 +0200
+++ afsd.c      2005-03-17 13:13:47.000000000 +0100
@@ -242,7 +242,7 @@
 int sawBiod = 0;
 char cacheMountDir[1024];      /*Mount directory for AFS */
 char rootVolume[64] = "root.afs";      /*AFS root volume name */
-afs_int32 cacheSetTime = 1;    /*Keep checking time to avoid drift? */
+afs_int32 cacheSetTime = FALSE;        /*Keep checking time to avoid drift? */
 afs_int32 isHomeCell;          /*Is current cell info for the home cell? */
 #ifdef AFS_XBSD_ENV
 int createAndTrunc = O_RDWR | O_CREAT | O_TRUNC;       /*Create & truncate on open */
@@ -1292,7 +1292,7 @@
 #endif
 
 mainproc(as, arock)
-     register struct cmd_syndesc *as;
+     struct cmd_syndesc *as;
      char *arock;
 {
     static char rn[] = "afsd"; /*Name of this routine */
@@ -1501,6 +1501,10 @@
        /* -rxbind */
        enable_rxbind = 1;
     }
+    if (as->parms[32].items) {
+       /* -settime */
+       cacheSetTime = TRUE;
+    }
 
     
     /*
@@ -2108,7 +2112,7 @@
      int argc;
      char **argv;
 {
-    register struct cmd_syndesc *ts;
+    struct cmd_syndesc *ts;
 
     ts = cmd_CreateSyntax(NULL, mainproc, NULL, "start AFS");
     cmd_AddParm(ts, "-blocks", CMD_SINGLE, CMD_OPTIONAL,
@@ -2177,6 +2181,8 @@
     cmd_AddParm(ts, "-backuptree", CMD_FLAG, CMD_OPTIONAL,
                "Prefer backup volumes for mointpoints in backup volumes");
     cmd_AddParm(ts, "-rxbind", CMD_FLAG, CMD_OPTIONAL, "Bind the Rx socket (one interface only)");
+    cmd_AddParm(ts, "-settime", CMD_FLAG, CMD_OPTIONAL,
+               "don't set the time");
     return (cmd_Dispatch(argc, argv));
 }