joe-beuhler-patches-20031122
authorJeffrey Altman <jaltman@grand.central.org>
Sun, 23 Nov 2003 04:52:52 +0000 (04:52 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 23 Nov 2003 04:52:52 +0000 (04:52 +0000)
Joe Beuhler's many patches merged into the tree

69 files changed:
src/WINNT/afsd/NTMakefile
src/WINNT/afsd/afsd.c
src/WINNT/afsd/afsd_init.c
src/WINNT/afsd/cm_config.c
src/WINNT/afsd/cm_conn.c
src/WINNT/afsd/cm_dns.c
src/WINNT/afsd/cm_freelance.c
src/WINNT/afsd/cm_ioctl.c
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb.h
src/WINNT/afsd/smb3.c
src/WINNT/client_exp/afs_shl_ext.cpp
src/WINNT/client_osi/osilog.c
src/WINNT/pthread/test/native.cpp
src/auth/cellconfig.c
src/bozo/bos.c
src/bozo/bosoprocs.c
src/bucoord/bc_status.c
src/bucoord/commands.c
src/bucoord/config.c
src/bucoord/dlq.c
src/bucoord/dsvs.c
src/bucoord/dump.c
src/bucoord/dump_sched.c
src/bucoord/main.c
src/bucoord/status.c
src/bucoord/ubik_db_if.c
src/bucoord/vol_sets.c
src/budb/db_hash.c
src/budb/db_text.c
src/budb/ol_verify.c
src/budb/procs.c
src/butc/dump.c
src/butc/lwps.c
src/butc/recoverDb.c
src/butc/tcmain.c
src/butc/tcprocs.c
src/butc/tcudbprocs.c
src/butm/file_tm.c
src/butm/test_ftm.c
src/config/util_cr.c
src/des/NTMakefile
src/kauth/admin_tools.c
src/kauth/kaauxdb.c
src/kauth/kadatabase.c
src/kauth/kaprocs.c
src/kauth/kaserver.c
src/libadmin/pts/afs_ptsAdmin.c
src/lwp/iomgr.c
src/ptserver/ptprocs.c
src/ptserver/pts.c
src/ptserver/testpt.c
src/ptserver/utils.c
src/rx/NTMakefile
src/rx/rxdebug.rc
src/ubik/lock.c
src/util/pthread_nosigs.h
src/viced/afsfileprocs.c
src/viced/callback.c
src/viced/host.c
src/viced/viced.c
src/vlserver/vldb_check.c
src/vol/ihandle.c
src/vol/nuke.c
src/vol/vol-salvage.c
src/volser/dumpstuff.c
src/volser/volprocs.c
src/volser/vos.c
src/volser/vsprocs.c

index 0a3f5ec..9ac219f 100644 (file)
@@ -135,9 +135,12 @@ MIDL_FLAGS=/app_config \
 
 CONF_DLLFILE = $(DESTDIR)\root.client\usr\vice\etc\libafsconf.dll
 
+CONF_DLLLIBS = \
+    $(DESTDIR)\lib\afs\afsutil.lib \
+    $(DESTDIR)\lib\afs\afsreg.lib
 
 $(CONF_DLLFILE): $(CONFOBJS) $(OUT)\libafsconf.res
-       $(DLLGUILINK) -def:libafsconf.def
+       $(DLLGUILINK) -def:libafsconf.def $(CONF_DLLLIBS)
        $(DLLPREP)
        $(COPY) $*.lib $(ILIBDIR)
        $(DEL) $*.lib $*.exp
index 0abd619..d5d31d1 100644 (file)
@@ -130,9 +130,8 @@ BOOL InitInstance(
        HWND hWnd;
        HDC hDC;
        TEXTMETRIC textmetric;
-       RECT rect;
        INT nLineHeight;
-        long code;
+    long code;
        char *reason;
  
        /* remember this, since it is a useful thing for some of the Windows
@@ -157,7 +156,6 @@ BOOL InitInstance(
        if (!hWnd)
                return (FALSE);
 
-
        /* lookup text dimensions */
        hDC = GetDC(hWnd);
        GetTextMetrics(hDC, &textmetric);
index 95e04e8..f0327d1 100644 (file)
@@ -603,7 +603,7 @@ int afsd_InitDaemons(char **reasonP)
           code = cm_GetVolumeByName(cm_rootCellp, cm_rootVolumeName, cm_rootUserp,
                                     &req, CM_FLAG_CREATE, &cm_rootVolumep);
           afsi_log("cm_GetVolumeByName code %x root vol %x", code,
-                   (code ? 0xffffffff : cm_rootVolumep));
+                   (code ? (cm_volume_t *)-1 : cm_rootVolumep));
           if (code != 0) {
             *reasonP = "can't find root volume in root cell";
             return -1;
@@ -622,7 +622,7 @@ int afsd_InitDaemons(char **reasonP)
         
         code = cm_GetSCache(&cm_rootFid, &cm_rootSCachep, cm_rootUserp, &req);
        afsi_log("cm_GetSCache code %x scache %x", code,
-                (code ? 0xffffffff : cm_rootSCachep));
+                (code ? (cm_scache_t *)-1 : cm_rootSCachep));
        if (code != 0) {
                *reasonP = "unknown error";
                return -1;
index 1d52d4e..41b0e5d 100644 (file)
@@ -33,7 +33,9 @@ char AFSConfigKeyName[] =
 #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
@@ -350,13 +352,13 @@ long cm_GetRootCellName(char *cellNamep)
 {
         FILE *thisCell;
         char thisCellPath[256];
-        char *afsconf_path;
         char *newline;
 
 #ifdef DJGPP
         strcpy(thisCellPath, cm_confDir);
 #else
         /* Win 95 */
+        char *afsconf_path;
         afsconf_path = getenv("AFSCONF");
         if (!afsconf_path)
           strcpy(thisCellPath, AFSDIR_CLIENT_ETC_DIRPATH);
@@ -385,14 +387,14 @@ long cm_GetRootCellName(char *cellNamep)
 cm_configFile_t *cm_CommonOpen(char *namep, char *rwp)
 {
        char wdir[256];
-        long code;
-        long tlen;
-        FILE *tfilep;
-        char *afsconf_path;
+    long code;
+    long tlen;
+    FILE *tfilep;
 
 #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
        code = GetWindowsDirectory(wdir, sizeof(wdir));
-        if (code == 0 || code > sizeof(wdir)) return NULL;
+        if (code == 0 || code > sizeof(wdir)) 
+            return 0;
         
        /* add trailing backslash, if required */
         tlen = strlen(wdir);
@@ -401,7 +403,7 @@ cm_configFile_t *cm_CommonOpen(char *namep, char *rwp)
 #ifdef DJGPP
         strcpy(wdir,cm_confDir);
 #else
-        afsconf_path = getenv("AFSCONF");
+        char *afsconf_path = getenv("AFSCONF");
         if (!afsconf_path)
           strcpy(wdir, AFSDIR_CLIENT_ETC_DIRPATH);
         else
@@ -552,12 +554,13 @@ long cm_AppendNewCellLine(cm_configFile_t *filep, char *linep)
 long cm_CloseCellFile(cm_configFile_t *filep)
 {
        char wdir[256];
-        char sdir[256];
-        long code;
-        long closeCode;
-        int tlen;
-        char *afsconf_path;
-
+    char sdir[256];
+    long code;
+    long closeCode;
+    int tlen;
+#ifdef AFS_WIN95_ENV
+    char *afsconf_path;
+#endif
        closeCode = fclose((FILE *)filep);
 
 #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
@@ -604,9 +607,11 @@ long cm_CloseCellFile(cm_configFile_t *filep)
 void cm_GetConfigDir(char *dir)
 {
        char wdir[256];
-     char *afsconf_path;
-     int code;
-     int tlen;
+    int code;
+    int tlen;
+#ifdef AFS_WIN95_ENV
+    char *afsconf_path;
+#endif
 
 #if !defined(DJGPP) && !defined(AFS_WIN95_ENV)
        code = GetWindowsDirectory(wdir, sizeof(wdir));
index 4d35c06..33e8daf 100644 (file)
@@ -222,7 +222,7 @@ cm_Analyze(cm_conn_t *connp, cm_user_t *userp, cm_req_t *reqp,
        /* special codes:  missing volumes */
        if (errorCode == VNOVOL || errorCode == VMOVED || errorCode == VOFFLINE
            || errorCode == VSALVAGE || errorCode == VNOSERVICE) {
-               long oldSum, newSum;
+               long newSum;
                int same;
 
                /* Log server being offline for this volume */
index b0e1da0..5f62d90 100644 (file)
@@ -41,7 +41,6 @@ int cm_InitDNS(int enabled)
   char configpath[100];
   int len;
   int code;
-  char *path;
   char *addr;
   
   if (!enabled) { fprintf(stderr, "DNS support disabled\n"); cm_dnsEnabled = 0; return 0; }
@@ -55,7 +54,7 @@ int cm_InitDNS(int enabled)
 #ifdef DJGPP
     strcpy(configpath, cm_confDir);
 #elif defined(AFS_WIN95_ENV)
-    path = getenv("AFSCONF");
+    char *path = getenv("AFSCONF");
     if (path) strcpy(configpath, path);
     else strcpy(configpath, "c:\\afscli");
 #else  /* nt */
@@ -250,7 +249,6 @@ PDNS_HDR get_DNS_Response(SOCKET commSock, SOCKADDR_IN sockAddr, char *buffer)
   /*static char buffer[BUFSIZE];*/
 
   int         addrLen = sizeof(SOCKADDR_IN);
-  int         res;
   int size;
 
 #ifndef WIN32_LEAN_AND_MEAN
@@ -548,7 +546,6 @@ u_char * processReplyBuffer_Addr(PDNS_HDR replyBuff)
 {
   u_char *ptr = (u_char *) replyBuff;
   int    answerCount = ntohs((replyBuff)->rr_count);
-  u_char i;
   PDNS_A_RR_HDR 
          rrPtr;
 
@@ -655,8 +652,6 @@ int DNSgetAddr(SOCKET commSock, char *hostName, struct in_addr *iNet)
 
   SOCKADDR_IN sockAddr;
   char buffer[BUFSIZE];
-  
-  int     i;
   u_char *addr;
   u_long *aPtr;
   int rc;
index 9f82b1c..efa1685 100644 (file)
@@ -49,11 +49,9 @@ void cm_InitFreelance() {
 /* to be called while holding freelance lock unless during init. */
 void cm_InitFakeRootDir() {
        
-       int i, j, t1, t2;
+       int i, t1, t2;
        char* currentPos;
        int noChunks;
-       char mask;
-       
 
        // allocate space for the fake info
        cm_dirHeader_t fakeDirHeader;
@@ -255,7 +253,7 @@ int cm_noteLocalMountPointChange() {
 
 int cm_reInitLocalMountPoints() {
        cm_fid_t aFid;
-       int i, j, hash;
+       int i, hash;
        cm_scache_t *scp, **lscpp, *tscp;
 
        
@@ -343,7 +341,7 @@ long cm_InitLocalMountPoints() {
        
        FILE *fp;
        char line[200];
-       int n, i;
+       int i;
        char* t;
        cm_localMountPoint_t* aLocalMountPoint;
        char hdir[120];
@@ -484,13 +482,12 @@ long cm_FreelanceAddMount(char *filename, char *cellname, char *volume, cm_fid_t
 
 long cm_FreelanceRemoveMount(char *toremove)
 {
-     int i, n, t1, t2;
+     int i, n;
      char* cp;
      char line[200];
      char shortname[200];
      char hfile[120], hfile2[120];
      FILE *fp1, *fp2;
-     char cmd[200];
      int found=0;
 
     lock_ObtainMutex(&cm_Freelance_Lock);
index 70b7d11..23c5f78 100644 (file)
@@ -112,16 +112,18 @@ void cm_ResetACLCache(cm_user_t *userp)
  */
 void TranslateExtendedChars(char *str)
 {
-  char *p;
-  
-        if (!str || !*str)
-                return;
+#ifdef DJGPP
+    char *p;
+#endif
+
+    if (!str || !*str)
+        return;
 
 #ifndef DJGPP
-        CharToOem(str, str);
+    CharToOem(str, str);
 #else
-        p = str;
-        while (*p) *p++ &= 0x7f;  /* turn off high bit; probably not right */
+    p = str;
+    while (*p) *p++ &= 0x7f;  /* turn off high bit; probably not right */
 #endif
 }
         
@@ -1320,8 +1322,6 @@ long cm_IoctlIslink(struct smb_ioctl *ioctlp, struct cm_user *userp)
        cm_scache_t *dscp;
        cm_scache_t *scp;
        char *cp;
-       cm_space_t *spacep;
-       cm_scache_t *newRootScp;
        cm_req_t req;
 
        cm_InitReq(&req);
index d85cbf5..3d6cfbe 100644 (file)
@@ -1095,9 +1095,9 @@ int smb_ListShares()
                   smb_localNamep, this_share, (print_afs ? cm_mountRoot : "\0"),
                   pathName);
           num_shares++;
-          while (*this_share != NULL) this_share++;  /* find next NULL */
-          this_share++;   /* skip past the NULL */
-        } while (*this_share != NULL);  /* stop at final NULL */
+          while (*this_share != 0) this_share++;  /* find next NUL */
+          this_share++;   /* skip past the NUL */
+        } while (*this_share != 0);  /* stop at final NUL */
 
         return num_shares;
 }
@@ -6177,7 +6177,6 @@ void smb_NetbiosInit()
     }
 #endif /* !DJGPP */
 
- try_addname:
     /* and declare our name so we can receive connections */
     memset(ncbp, 0, sizeof(*ncbp));
     len=lstrlen(smb_localNamep);
@@ -6293,11 +6292,8 @@ void smb_Init(osi_log_t *logp, char *snamep, int useV3, int LANadapt,
        thread_t phandle;
     int lpid;
     int i;
-    long code;
     int len;
-    NCB *ncbp;
        struct tm myTime;
-       char s[100];
 #ifdef DJGPP
     int npar, seg, sel;
     dos_ptr rawBuf;
index 8afe8d4..ac677e1 100644 (file)
@@ -334,7 +334,7 @@ extern void smb_DosUTimeFromUnixTime(long *dosUTimep, long unixTime);
 
 extern void smb_UnixTimeFromDosUTime(long *unixTimep, long dosUTime);
 
-extern smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana);\r
+extern smb_vc_t *smb_FindVC(unsigned short lsn, int flags, int lana);
 
 extern void smb_ReleaseVC(smb_vc_t *vcp);
 
@@ -344,6 +344,10 @@ extern void smb_ReleaseTID(smb_tid_t *tidp);
 
 extern smb_user_t *smb_FindUID(smb_vc_t *vcp, unsigned short uid, int flags);
 
+extern smb_username_t *smb_FindUserByName(char *usern, char *machine, int flags);
+
+extern smb_user_t *smb_FindUserByNameThisSession(smb_vc_t *vcp, char *usern); 
+
 extern void smb_ReleaseUID(smb_user_t *uidp);
 
 extern cm_user_t *smb_GetUser(smb_vc_t *vcp, smb_packet_t *inp);
@@ -423,6 +427,8 @@ extern unsigned long smb_LogoffTransferTimeout;
 extern void smb_FormatResponsePacket(smb_vc_t *vcp, smb_packet_t *inp,
        smb_packet_t *op);
 
+extern char *myCrt_2Dispatch(int i); 
+
 extern unsigned int smb_Attributes(cm_scache_t *scp);
 
 extern int smb_ChainFID(int fid, smb_packet_t *inp);
@@ -453,7 +459,7 @@ extern BOOL smb_IsLegalFilename(char *filename);
 #include "smb3.h"
 #include "smb_ioctl.h"
 #include "smb_iocons.h"
-\r
-cm_user_t *smb_FindOrCreateUser(smb_vc_t *vcp, char *usern);\r
+
+cm_user_t *smb_FindOrCreateUser(smb_vc_t *vcp, char *usern);
 
 #endif /* whole file */
index 9e08a5d..3d08c3a 100644 (file)
@@ -113,7 +113,7 @@ long smb_ReceiveV3SessionSetupX(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *
 {
     char *tp;
     char *usern, *pwd, *pwdx;
-    smb_user_t *uidp, *dead_uidp;
+    smb_user_t *uidp;
     unsigned short newUid;
     unsigned long caps;
     cm_user_t *userp;
index d1eebfa..6c4d9c8 100644 (file)
@@ -119,14 +119,13 @@ LRESULT DoRegCLSID(HKEY hKey,PTCHAR szSubKey,PTCHAR szData,PTCHAR szValue=NULL)
 // by exporting DllRegisterServer, you can use regsvr.exe
 STDAPI DllRegisterServer(void)
 {
-       int      i;
        HKEY     hKey;
        LRESULT  lResult;
        DWORD    dwDisp;
        TCHAR    szSubKey[MAX_PATH];
        TCHAR    szCLSID[MAX_PATH];
-       TCHAR    szModule[MAX_PATH];
-       LPWSTR   pwsz;
+    TCHAR    szModule[MAX_PATH];
+    LPWSTR   pwsz;
        AFX_MANAGE_STATE(AfxGetStaticModuleState());
        COleObjectFactory::UpdateRegistryAll();
 
index 13a76ab..09298cf 100644 (file)
@@ -355,7 +355,8 @@ void osi_InitTraceOption()
 #define MAXBUF_ 131
 void osi_LogEvent0(char *a,char *b) 
 {
-       HANDLE h; char *ptbuf[1],buf[MAXBUF_+1];
+       HANDLE h; 
+    char *ptbuf[1];
        if (!ISLOGONTRACE(osi_TraceOption))
                return;
        h = RegisterEventSource(NULL, AFS_DAEMON_EVENT_NAME);
index 377b5f9..5d82dac 100644 (file)
-/*\r
- * Copyright 2000, International Business Machines Corporation and others.\r
- * All Rights Reserved.\r
- * \r
- * This software has been released under the terms of the IBM Public\r
- * License.  For details, see the LICENSE file in the top-level source\r
- * directory or online at http://www.openafs.org/dl/license10.html\r
- */\r
-\r
-/*\r
- * Test pthread interaction with native Win32 threads\r
- *\r
- */\r
-\r
-\r
-#include <afs/param.h>\r
-#include <afs/stds.h>\r
-\r
-#include <windows.h>\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-\r
-extern "C" {\r
-#include <pthread.h>\r
-#include <assert.h>\r
-#include <rx/rx_queue.h>\r
-}\r
-\r
-\r
-#define nTESTS         3\r
-#define nPASSES_MAX  256\r
-\r
-\r
-/*\r
- * Test1 - Tests the main thread calling pthread_self()\r
- *\r
- */\r
-\r
-BOOL Test1 (void)\r
-{\r
-   BOOL rc = TRUE;\r
-   printf ("Begin Test1:\n");\r
-\r
-   PVOID hSelf;\r
-   if ((hSelf = pthread_self()) == NULL)\r
-      rc = FALSE;\r
-\r
-   printf ("   1: pthread_self() on main thread returned 0x%08lX\n", hSelf);\r
-\r
-   printf ("--> Test1 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED\a\a\a"));\r
-   return rc;\r
-}\r
-\r
-\r
-/*\r
- * Test2 - Tests a Win32 thread's ability to join onto a pthread\r
- *\r
- */\r
-#define TEST2_RETURNVALUE 'Test'\r
-\r
-DWORD WINAPI Test2_Thread1 (LPVOID lp)\r
-{\r
-   printf ("   1-1: waiting for thread 2 to begin\n");\r
-\r
-   while (!*(volatile DWORD*)lp)\r
-      ;\r
-\r
-   printf ("   1-1: calling pthread_join (0x%08lX)\n", *(DWORD*)lp);\r
-\r
-   DWORD status;\r
-   int rc;\r
-   if ((rc = pthread_join ((pthread_t)(*(DWORD*)lp), (void**)&status)) != 0)\r
-      {\r
-      printf ("   1-1: pthread_join failed; rc=%lu\n", rc);\r
-      return 0;\r
-      }\r
-\r
-   if (status != TEST2_RETURNVALUE)\r
-      {\r
-      printf ("   1-1: pthread_join succeeded with wrong status (rc=%lu)\n", status);\r
-      return 0;\r
-      }\r
-\r
-   printf ("   1-1: pthread_join succeeded; terminating\n");\r
-   return 1;\r
-}\r
-\r
-extern "C" void *Test2_Thread2 (void *pdwCommonParam)\r
-{\r
-   printf ("   1-2: signalling that thread 2 began\n");\r
-   *(volatile DWORD*)pdwCommonParam = (DWORD)pthread_self();\r
-   Sleep (1500);\r
-\r
-   printf ("   1-2: terminating\n");\r
-   return (void*)TEST2_RETURNVALUE;\r
-}\r
-\r
-BOOL Test2 (void)\r
-{\r
-   BOOL rc = TRUE;\r
-   printf ("Begin Test2:\n");\r
-\r
-   DWORD dwCommonParam = 0;\r
-   DWORD idThread;\r
-\r
-   printf ("   1: creating win32 thread\n");\r
-   HANDLE hThread1 = CreateThread (0, 0, Test2_Thread1, (LPVOID)&dwCommonParam, 0, &idThread);\r
-   Sleep(500);\r
-\r
-   printf ("   1: creating pthread thread\n");\r
-   pthread_t hThread2;\r
-   pthread_create (&hThread2, NULL, Test2_Thread2, (void *)&dwCommonParam);\r
-   Sleep(500);\r
-\r
-   printf ("   1: blocking until win32 thread (thread1) terminates...\n");\r
-\r
-   WaitForSingleObject (hThread1, INFINITE);\r
-   GetExitCodeThread (hThread1, (ULONG*)&rc);\r
-\r
-   printf ("   1: detected thread1 termination\n");\r
-\r
-   printf ("--> Test2 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED\a\a\a"));\r
-   return rc;\r
-}\r
-\r
-\r
-/*\r
- * Test3 - Makes sure the pthread library recognizes when native threads die\r
- *\r
- */\r
-\r
-DWORD WINAPI Test3_Thread1 (LPVOID lp)\r
-{\r
-   LONG *pdw = (LONG*)lp;\r
-\r
-   // We're awake. Do something pthready.\r
-   //\r
-   pthread_t pMe;\r
-   if ((pMe = pthread_self()) == NULL)\r
-      printf ("   3-1: could not get a pthread_self!\n");\r
-   else\r
-      printf ("   3-1: ready\n");\r
-\r
-   InterlockedIncrement (pdw);\r
-\r
-   // Now wait until we see the signal to die.\r
-   //\r
-   while (*(volatile LONG*)pdw != 5)\r
-      ;\r
-\r
-   printf ("   3-1: terminating\n");\r
-   InterlockedIncrement (pdw);\r
-   return 1;\r
-}\r
-\r
-\r
-DWORD WINAPI Test3_Thread2 (LPVOID lp)\r
-{\r
-   LONG *pdw = (LONG*)lp;\r
-\r
-   // We're awake. Do something pthready.\r
-   //\r
-   pthread_t pMe;\r
-   if ((pMe = pthread_self()) == NULL)\r
-      printf ("   3-2: could not get a pthread_self!\n");\r
-   else\r
-      printf ("   3-2: ready\n");\r
-\r
-   InterlockedIncrement (pdw);\r
-\r
-   // Now wait until we see the signal to die.\r
-   //\r
-   while (*(volatile LONG*)pdw != 7)\r
-      ;\r
-\r
-   printf ("   3-2: terminating\n");\r
-   InterlockedIncrement (pdw);\r
-   return 1;\r
-}\r
-\r
-\r
-extern "C" void *Test3_Thread3 (void *pdwParam)\r
-{\r
-   LONG *pdw = (LONG*)pdwParam;\r
-\r
-   // We're awake.\r
-   //\r
-   printf ("   3-3: ready\n");\r
-   InterlockedIncrement (pdw);\r
-\r
-   // Now wait until we see the signal to die.\r
-   //\r
-   while (*(volatile LONG*)pdw != 9)\r
-      ;\r
-\r
-   printf ("   3-3: terminating\n");\r
-   InterlockedIncrement (pdw);\r
-   return (void*)1;\r
-}\r
-\r
-\r
-extern "C" void *Test3_Thread4 (void *pdwParam)\r
-{\r
-   LONG *pdw = (LONG*)pdwParam;\r
-\r
-   // We're awake.\r
-   //\r
-   printf ("   3-4: ready\n");\r
-   InterlockedIncrement (pdw);\r
-\r
-   // Now wait until we see the signal to die.\r
-   //\r
-   while (*(volatile LONG*)pdw != 11)\r
-      ;\r
-\r
-   printf ("   3-4: terminating\n");\r
-   InterlockedIncrement (pdw);\r
-   return (void*)1;\r
-}\r
-\r
-\r
-extern "C" void *Test3_ThreadCount (void *pdwParam)\r
-{\r
-   volatile LONG *pdw = (LONG*)pdwParam;\r
-\r
-   pthread_t pMe;\r
-   if ((pMe = pthread_self()) == NULL)\r
-      return (void*)0;\r
-\r
-   try {\r
-      struct rx_queue *pNow = (rx_queue*)pMe;\r
-\r
-      for (struct rx_queue *pWalk = pNow->next; pWalk != pNow; pWalk = pWalk->next)\r
-         ++(*pdw);\r
-\r
-    } catch(...) {\r
-       *pdw = 0;\r
-    }\r
-\r
-   return (void*)*pdw;\r
-}\r
-\r
-size_t Test3_CountActiveQueue (void)\r
-{\r
-   DWORD dwArg = 0;\r
-   pthread_t pThread;\r
-   pthread_create (&pThread, NULL, Test3_ThreadCount, (void *)&dwArg);\r
-\r
-   DWORD status;\r
-   int rc;\r
-   if ((rc = pthread_join (pThread, (void**)&status)) != 0)\r
-      {\r
-      printf ("   3: counter: pthread_join failed; rc=%lu\n", rc);\r
-      return 0;\r
-      }\r
-\r
-   return dwArg;\r
-}\r
-\r
-BOOL Test3 (void)\r
-{\r
-   BOOL rc = TRUE;\r
-   printf ("Begin Test3:\n");\r
-\r
-   // Find the size of the active queue\r
-   //\r
-   size_t cInitialQueueSize;\r
-   if ((cInitialQueueSize = Test3_CountActiveQueue()) == 0)\r
-      {\r
-      printf ("   3: unable to determine active queue size\n");\r
-      rc = FALSE;\r
-      }\r
-   else\r
-      {\r
-      // Start two Win32 threads and two pthreads. We'll use a single, common\r
-      // parameter for each thread: dwSignal. Each thread will increment the\r
-      // signal param when it's ready for us to go; once that's done, a\r
-      // thread will kill itself and inc the signal *again* each die we\r
-      // increment the signal:\r
-      //\r
-      //    starts at 0\r
-      //    thread 1 wakes up and incs signal to 1\r
-      //    thread 2 wakes up and incs signal to 2\r
-      //    thread 3 wakes up and incs signal to 3\r
-      //    thread 4 wakes up and incs signal to 4\r
-      //    we notice signal is 4, and we increment signal to 5\r
-      //    thread 1 notices signal is 5, incs to 6 and dies\r
-      //    we notice signal is 6, and we increment signal to 7\r
-      //    thread 1 notices signal is 7, incs to 8 and dies\r
-      //    we notice signal is 8, and we increment signal to 9\r
-      //    thread 1 notices signal is 9, incs to 10 and dies\r
-      //    we notice signal is 10, and we increment signal to 11\r
-      //    thread 1 notices signal is 11, incs to 12 and dies\r
-      //    we notice signal is 12 and finish our tests\r
-      //\r
-      volatile LONG dwSignal = 0;\r
-      printf ("   3: creating test threads\n");\r
-\r
-      DWORD idThread;\r
-      CreateThread (0, 0, Test3_Thread1, (LPVOID)&dwSignal, 0, &idThread);\r
-      Sleep (500);\r
-\r
-      CreateThread (0, 0, Test3_Thread2, (LPVOID)&dwSignal, 0, &idThread);\r
-      Sleep (500);\r
-\r
-      pthread_attr_t attr;\r
-      attr.is_joinable = PTHREAD_CREATE_DETACHED;\r
-\r
-      pthread_t hThread;\r
-      pthread_create (&hThread, &attr, Test3_Thread3, (void *)&dwSignal);\r
-      Sleep (500);\r
-\r
-      pthread_create (&hThread, &attr, Test3_Thread4, (void *)&dwSignal);\r
-      Sleep (500);\r
-\r
-      // Count the active queue again as soon as we're sure all the threads\r
-      // are ready for us to do so.\r
-      //\r
-      while (dwSignal != 4)\r
-         ;\r
-\r
-      size_t cQueueSize;\r
-      if ((cQueueSize = Test3_CountActiveQueue()) == 0)\r
-         {\r
-         printf ("   3: unable to determine active queue size\n");\r
-         rc = FALSE;\r
-         }\r
-      else if (cQueueSize != cInitialQueueSize+4)\r
-         {\r
-         printf ("   3: error: active queue wasn't increased by 4\n");\r
-         rc = FALSE;\r
-         }\r
-      else while (rc && (dwSignal < 12))\r
-         {\r
-         LONG dwTarget = dwSignal +2;\r
-         InterlockedIncrement ((LONG*)&dwSignal);\r
-\r
-         // wait for a thread to notice the change and kill itself\r
-         while (dwSignal != dwTarget)\r
-            ;\r
-         Sleep (500); // give a little time for cleanup after thread incremented\r
-\r
-         if ((cQueueSize = Test3_CountActiveQueue()) == 0)\r
-            {\r
-            printf ("   3: unable to determine active queue size (dwSignal=%ld)\n", dwSignal);\r
-            rc = FALSE;\r
-            }\r
-         else if (cQueueSize != (cInitialQueueSize + 4 - ((dwTarget -4) /2)))\r
-            {\r
-            printf ("   3: active queue size did not diminish (dwSignal=%ld)\n", dwSignal);\r
-            rc = FALSE;\r
-            }\r
-         }\r
-      }\r
-\r
-   printf ("--> Test3 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED\a\a\a"));\r
-   return rc;\r
-}\r
-\r
-\r
-/*\r
- * main - Runs all tests (unless the command-line says otherwise)\r
- *\r
- */\r
-int main(int argc, char **argv)\r
-{\r
-   DWORD iRunTest[nPASSES_MAX];\r
-   for (size_t ii = 0; ii < nPASSES_MAX; ++ii)\r
-      iRunTest[ii] = (ii < nTESTS) ? (ii+1) : 0;\r
-\r
-   ii = 0;\r
-   for (--argc,++argv; argc; --argc,++argv)\r
-      {\r
-      DWORD iTest;\r
-      if ( ((iTest = (size_t)atol (*argv)) > 0) && (iTest <= nTESTS) )\r
-         {\r
-         if (ii == 0)\r
-            memset (iRunTest, 0x00, sizeof(iRunTest));\r
-         if (ii < nPASSES_MAX)\r
-            iRunTest[ ii++ ] = iTest;\r
-         }\r
-      }\r
-\r
-   BOOL rc = TRUE;\r
-\r
-   for (ii = 0; ii < nPASSES_MAX; ++ii)\r
-      {\r
-      if (iRunTest[ ii ] == 0)\r
-         break;\r
-      else switch (iRunTest[ ii ])\r
-         {\r
-         case 1: if (!Test1()) rc = FALSE;  break;\r
-         case 2: if (!Test2()) rc = FALSE;  break;\r
-         case 3: if (!Test3()) rc = FALSE;  break;\r
-         }\r
-      }\r
-\r
-   return rc;\r
-}\r
-\r
+/*\r\r
+ * Copyright 2000, International Business Machines Corporation and others.\r\r
+ * All Rights Reserved.\r\r
+ * \r\r
+ * This software has been released under the terms of the IBM Public\r\r
+ * License.  For details, see the LICENSE file in the top-level source\r\r
+ * directory or online at http://www.openafs.org/dl/license10.html\r\r
+ */\r\r
+\r\r
+/*\r\r
+ * Test pthread interaction with native Win32 threads\r\r
+ *\r\r
+ */\r\r
+\r\r
+\r\r
+#include <afs/param.h>\r\r
+#include <afs/stds.h>\r\r
+\r\r
+#include <windows.h>\r\r
+#include <stdio.h>\r\r
+#include <stdlib.h>\r\r
+\r\r
+extern "C" {\r\r
+#include <pthread.h>\r\r
+#include <assert.h>\r\r
+#include <rx/rx_queue.h>\r\r
+}\r\r
+\r\r
+\r\r
+#define nTESTS         3\r\r
+#define nPASSES_MAX  256\r\r
+\r\r
+\r\r
+/*\r\r
+ * Test1 - Tests the main thread calling pthread_self()\r\r
+ *\r\r
+ */\r\r
+\r\r
+BOOL Test1 (void)\r\r
+{\r\r
+   BOOL rc = TRUE;\r\r
+   printf ("Begin Test1:\n");\r\r
+\r\r
+   PVOID hSelf;\r\r
+   if ((hSelf = pthread_self()) == NULL)\r\r
+      rc = FALSE;\r\r
+\r\r
+   printf ("   1: pthread_self() on main thread returned 0x%08lX\n", hSelf);\r\r
+\r\r
+   printf ("--> Test1 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED\a\a\a"));\r\r
+   return rc;\r\r
+}\r\r
+\r\r
+\r\r
+/*\r\r
+ * Test2 - Tests a Win32 thread's ability to join onto a pthread\r\r
+ *\r\r
+ */\r\r
+#define TEST2_RETURNVALUE 'Test'\r\r
+\r\r
+DWORD WINAPI Test2_Thread1 (LPVOID lp)\r\r
+{\r\r
+   printf ("   1-1: waiting for thread 2 to begin\n");\r\r
+\r\r
+   while (!*(volatile DWORD*)lp)\r\r
+      ;\r\r
+\r\r
+   printf ("   1-1: calling pthread_join (0x%08lX)\n", *(DWORD*)lp);\r\r
+\r\r
+   DWORD status;\r\r
+   int rc;\r\r
+   if ((rc = pthread_join ((pthread_t)(*(DWORD*)lp), (void**)&status)) != 0)\r\r
+      {\r\r
+      printf ("   1-1: pthread_join failed; rc=%lu\n", rc);\r\r
+      return 0;\r\r
+      }\r\r
+\r\r
+   if (status != TEST2_RETURNVALUE)\r\r
+      {\r\r
+      printf ("   1-1: pthread_join succeeded with wrong status (rc=%lu)\n", status);\r\r
+      return 0;\r\r
+      }\r\r
+\r\r
+   printf ("   1-1: pthread_join succeeded; terminating\n");\r\r
+   return 1;\r\r
+}\r\r
+\r\r
+extern "C" void *Test2_Thread2 (void *pdwCommonParam)\r\r
+{\r\r
+   printf ("   1-2: signalling that thread 2 began\n");\r\r
+   *(volatile DWORD*)pdwCommonParam = (DWORD)pthread_self();\r\r
+   Sleep (1500);\r\r
+\r\r
+   printf ("   1-2: terminating\n");\r\r
+   return (void*)TEST2_RETURNVALUE;\r\r
+}\r\r
+\r\r
+BOOL Test2 (void)\r\r
+{\r\r
+   BOOL rc = TRUE;\r\r
+   printf ("Begin Test2:\n");\r\r
+\r\r
+   DWORD dwCommonParam = 0;\r\r
+   DWORD idThread;\r\r
+\r\r
+   printf ("   1: creating win32 thread\n");\r\r
+   HANDLE hThread1 = CreateThread (0, 0, Test2_Thread1, (LPVOID)&dwCommonParam, 0, &idThread);\r\r
+   Sleep(500);\r\r
+\r\r
+   printf ("   1: creating pthread thread\n");\r\r
+   pthread_t hThread2;\r\r
+   pthread_create (&hThread2, NULL, Test2_Thread2, (void *)&dwCommonParam);\r\r
+   Sleep(500);\r\r
+\r\r
+   printf ("   1: blocking until win32 thread (thread1) terminates...\n");\r\r
+\r\r
+   WaitForSingleObject (hThread1, INFINITE);\r\r
+   GetExitCodeThread (hThread1, (ULONG*)&rc);\r\r
+\r\r
+   printf ("   1: detected thread1 termination\n");\r\r
+\r\r
+   printf ("--> Test2 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED\a\a\a"));\r\r
+   return rc;\r\r
+}\r\r
+\r\r
+\r\r
+/*\r\r
+ * Test3 - Makes sure the pthread library recognizes when native threads die\r\r
+ *\r\r
+ */\r\r
+\r\r
+DWORD WINAPI Test3_Thread1 (LPVOID lp)\r\r
+{\r\r
+   LONG *pdw = (LONG*)lp;\r\r
+\r\r
+   // We're awake. Do something pthready.\r\r
+   //\r\r
+   pthread_t pMe;\r\r
+   if ((pMe = pthread_self()) == NULL)\r\r
+      printf ("   3-1: could not get a pthread_self!\n");\r\r
+   else\r\r
+      printf ("   3-1: ready\n");\r\r
+\r\r
+   InterlockedIncrement (pdw);\r\r
+\r\r
+   // Now wait until we see the signal to die.\r\r
+   //\r\r
+   while (*(volatile LONG*)pdw != 5)\r\r
+      ;\r\r
+\r\r
+   printf ("   3-1: terminating\n");\r\r
+   InterlockedIncrement (pdw);\r\r
+   return 1;\r\r
+}\r\r
+\r\r
+\r\r
+DWORD WINAPI Test3_Thread2 (LPVOID lp)\r\r
+{\r\r
+   LONG *pdw = (LONG*)lp;\r\r
+\r\r
+   // We're awake. Do something pthready.\r\r
+   //\r\r
+   pthread_t pMe;\r\r
+   if ((pMe = pthread_self()) == NULL)\r\r
+      printf ("   3-2: could not get a pthread_self!\n");\r\r
+   else\r\r
+      printf ("   3-2: ready\n");\r\r
+\r\r
+   InterlockedIncrement (pdw);\r\r
+\r\r
+   // Now wait until we see the signal to die.\r\r
+   //\r\r
+   while (*(volatile LONG*)pdw != 7)\r\r
+      ;\r\r
+\r\r
+   printf ("   3-2: terminating\n");\r\r
+   InterlockedIncrement (pdw);\r\r
+   return 1;\r\r
+}\r\r
+\r\r
+\r\r
+extern "C" void *Test3_Thread3 (void *pdwParam)\r\r
+{\r\r
+   LONG *pdw = (LONG*)pdwParam;\r\r
+\r\r
+   // We're awake.\r\r
+   //\r\r
+   printf ("   3-3: ready\n");\r\r
+   InterlockedIncrement (pdw);\r\r
+\r\r
+   // Now wait until we see the signal to die.\r\r
+   //\r\r
+   while (*(volatile LONG*)pdw != 9)\r\r
+      ;\r\r
+\r\r
+   printf ("   3-3: terminating\n");\r\r
+   InterlockedIncrement (pdw);\r\r
+   return (void*)1;\r\r
+}\r\r
+\r\r
+\r\r
+extern "C" void *Test3_Thread4 (void *pdwParam)\r\r
+{\r\r
+   LONG *pdw = (LONG*)pdwParam;\r\r
+\r\r
+   // We're awake.\r\r
+   //\r\r
+   printf ("   3-4: ready\n");\r\r
+   InterlockedIncrement (pdw);\r\r
+\r\r
+   // Now wait until we see the signal to die.\r\r
+   //\r\r
+   while (*(volatile LONG*)pdw != 11)\r\r
+      ;\r\r
+\r\r
+   printf ("   3-4: terminating\n");\r\r
+   InterlockedIncrement (pdw);\r\r
+   return (void*)1;\r\r
+}\r\r
+\r\r
+\r\r
+extern "C" void *Test3_ThreadCount (void *pdwParam)\r\r
+{\r\r
+   volatile LONG *pdw = (LONG*)pdwParam;\r\r
+\r\r
+   pthread_t pMe;\r\r
+   if ((pMe = pthread_self()) == NULL)\r\r
+      return (void*)0;\r\r
+\r\r
+   try {\r\r
+      struct rx_queue *pNow = (rx_queue*)pMe;\r\r
+\r\r
+      for (struct rx_queue *pWalk = pNow->next; pWalk != pNow; pWalk = pWalk->next)\r\r
+         ++(*pdw);\r\r
+\r\r
+    } catch(...) {\r\r
+       *pdw = 0;\r\r
+    }\r\r
+\r\r
+   return (void*)*pdw;\r\r
+}\r\r
+\r\r
+size_t Test3_CountActiveQueue (void)\r\r
+{\r\r
+   DWORD dwArg = 0;\r\r
+   pthread_t pThread;\r\r
+   pthread_create (&pThread, NULL, Test3_ThreadCount, (void *)&dwArg);\r\r
+\r\r
+   DWORD status;\r\r
+   int rc;\r\r
+   if ((rc = pthread_join (pThread, (void**)&status)) != 0)\r\r
+      {\r\r
+      printf ("   3: counter: pthread_join failed; rc=%lu\n", rc);\r\r
+      return 0;\r\r
+      }\r\r
+\r\r
+   return dwArg;\r\r
+}\r\r
+\r\r
+BOOL Test3 (void)\r\r
+{\r\r
+   BOOL rc = TRUE;\r\r
+   printf ("Begin Test3:\n");\r\r
+\r\r
+   // Find the size of the active queue\r\r
+   //\r\r
+   size_t cInitialQueueSize;\r\r
+   if ((cInitialQueueSize = Test3_CountActiveQueue()) == 0)\r\r
+      {\r\r
+      printf ("   3: unable to determine active queue size\n");\r\r
+      rc = FALSE;\r\r
+      }\r\r
+   else\r\r
+      {\r\r
+      // Start two Win32 threads and two pthreads. We'll use a single, common\r\r
+      // parameter for each thread: dwSignal. Each thread will increment the\r\r
+      // signal param when it's ready for us to go; once that's done, a\r\r
+      // thread will kill itself and inc the signal *again* each die we\r\r
+      // increment the signal:\r\r
+      //\r\r
+      //    starts at 0\r\r
+      //    thread 1 wakes up and incs signal to 1\r\r
+      //    thread 2 wakes up and incs signal to 2\r\r
+      //    thread 3 wakes up and incs signal to 3\r\r
+      //    thread 4 wakes up and incs signal to 4\r\r
+      //    we notice signal is 4, and we increment signal to 5\r\r
+      //    thread 1 notices signal is 5, incs to 6 and dies\r\r
+      //    we notice signal is 6, and we increment signal to 7\r\r
+      //    thread 1 notices signal is 7, incs to 8 and dies\r\r
+      //    we notice signal is 8, and we increment signal to 9\r\r
+      //    thread 1 notices signal is 9, incs to 10 and dies\r\r
+      //    we notice signal is 10, and we increment signal to 11\r\r
+      //    thread 1 notices signal is 11, incs to 12 and dies\r\r
+      //    we notice signal is 12 and finish our tests\r\r
+      //\r\r
+      volatile LONG dwSignal = 0;\r\r
+      printf ("   3: creating test threads\n");\r\r
+\r\r
+      DWORD idThread;\r\r
+      CreateThread (0, 0, Test3_Thread1, (LPVOID)&dwSignal, 0, &idThread);\r\r
+      Sleep (500);\r\r
+\r\r
+      CreateThread (0, 0, Test3_Thread2, (LPVOID)&dwSignal, 0, &idThread);\r\r
+      Sleep (500);\r\r
+\r\r
+      pthread_attr_t attr;\r\r
+      attr.is_joinable = PTHREAD_CREATE_DETACHED;\r\r
+\r\r
+      pthread_t hThread;\r\r
+      pthread_create (&hThread, &attr, Test3_Thread3, (void *)&dwSignal);\r\r
+      Sleep (500);\r\r
+\r\r
+      pthread_create (&hThread, &attr, Test3_Thread4, (void *)&dwSignal);\r\r
+      Sleep (500);\r\r
+\r\r
+      // Count the active queue again as soon as we're sure all the threads\r\r
+      // are ready for us to do so.\r\r
+      //\r\r
+      while (dwSignal != 4)\r\r
+         ;\r\r
+\r\r
+      size_t cQueueSize;\r\r
+      if ((cQueueSize = Test3_CountActiveQueue()) == 0)\r\r
+         {\r\r
+         printf ("   3: unable to determine active queue size\n");\r\r
+         rc = FALSE;\r\r
+         }\r\r
+      else if (cQueueSize != cInitialQueueSize+4)\r\r
+         {\r\r
+         printf ("   3: error: active queue wasn't increased by 4\n");\r\r
+         rc = FALSE;\r\r
+         }\r\r
+      else while (rc && (dwSignal < 12))\r\r
+         {\r\r
+         LONG dwTarget = dwSignal +2;\r\r
+         InterlockedIncrement ((LONG*)&dwSignal);\r\r
+\r\r
+         // wait for a thread to notice the change and kill itself\r\r
+         while (dwSignal != dwTarget)\r\r
+            ;\r\r
+         Sleep (500); // give a little time for cleanup after thread incremented\r\r
+\r\r
+         if ((cQueueSize = Test3_CountActiveQueue()) == 0)\r\r
+            {\r\r
+            printf ("   3: unable to determine active queue size (dwSignal=%ld)\n", dwSignal);\r\r
+            rc = FALSE;\r\r
+            }\r\r
+         else if (cQueueSize != (cInitialQueueSize + 4 - ((dwTarget -4) /2)))\r\r
+            {\r\r
+            printf ("   3: active queue size did not diminish (dwSignal=%ld)\n", dwSignal);\r\r
+            rc = FALSE;\r\r
+            }\r\r
+         }\r\r
+      }\r\r
+\r\r
+   printf ("--> Test3 %s\n", (rc) ? TEXT("succeeded") : TEXT("FAILED\a\a\a"));\r\r
+   return rc;\r\r
+}\r\r
+\r\r
+\r\r
+/*\r\r
+ * main - Runs all tests (unless the command-line says otherwise)\r\r
+ *\r\r
+ */\r\r
+int main(int argc, char **argv)\r\r
+{\r\r
+   DWORD iRunTest[nPASSES_MAX];\r\r
+   for (size_t ii = 0; ii < nPASSES_MAX; ++ii)\r\r
+      iRunTest[ii] = (ii < nTESTS) ? (ii+1) : 0;\r\r
+\r\r
+   ii = 0;\r\r
+   for (--argc,++argv; argc; --argc,++argv)\r\r
+      {\r\r
+      DWORD iTest;\r\r
+      if ( ((iTest = (size_t)atol (*argv)) > 0) && (iTest <= nTESTS) )\r\r
+         {\r\r
+         if (ii == 0)\r\r
+            memset (iRunTest, 0x00, sizeof(iRunTest));\r\r
+         if (ii < nPASSES_MAX)\r\r
+            iRunTest[ ii++ ] = iTest;\r\r
+         }\r\r
+      }\r\r
+\r\r
+   BOOL rc = TRUE;\r\r
+\r\r
+   for (ii = 0; ii < nPASSES_MAX; ++ii)\r\r
+      {\r\r
+      if (iRunTest[ ii ] == 0)\r\r
+         break;\r\r
+      else switch (iRunTest[ ii ])\r\r
+         {\r\r
+         case 1: if (!Test1()) rc = FALSE;  break;\r\r
+         case 2: if (!Test2()) rc = FALSE;  break;\r\r
+         case 3: if (!Test3()) rc = FALSE;  break;\r\r
+         }\r\r
+      }\r\r
+\r\r
+   return rc;\r\r
+}\r\r
+\r\r
index e277325..c02a770 100644 (file)
@@ -786,12 +786,10 @@ afsconf_GetAfsdbInfo(char *acellName, char *aservice,
     register afs_int32 i;
     int tservice;
     struct afsconf_entry DNSce;
-    char *DNStmpStrp;          /* a temp string pointer */
-    struct hostent *thp;
     afs_int32 cellHosts[AFSMAXCELLHOSTS];
     int numServers;
     int rc;
-    int *ttl;
+    int ttl;
 
     DNSce.cellInfo.numServers = 0;
     DNSce.next = NULL;
index 412510f..086c68d 100644 (file)
@@ -1500,7 +1500,7 @@ SalvageCmd(as)
 
     /* Find out whether fileserver is running MR-AFS (has a scanner instance) */
     /* XXX this should really be done some other way, potentially by RPC */
-    tp = &tname;
+    tp = &tname[0];
     if (code = BOZO_GetInstanceParm(tconn, "fs", 3, &tp) == 0)
        mrafs = 1;
 
index c628693..3d1181c 100644 (file)
@@ -774,7 +774,7 @@ SBOZO_ListSUsers(acall, an, aname)
     *tp = 0;                   /* in case getnthuser doesn't null-terminate the string */
     code = afsconf_GetNthUser(bozo_confdir, an, tp, 256);
 
-  fail:
+  /* fail: */
     osi_auditU(acall, BOS_ListSUserEvent, code, AUD_END);
     return code;
 }
index 476b40e..8cf694b 100644 (file)
@@ -103,6 +103,7 @@ nextItem(linkPtr)
 
 char *cmdLine;
 
+int
 cmdDispatch()
 {
 #define        MAXV    100
@@ -127,6 +128,7 @@ cmdDispatch()
      */
     doDispatch(targc, targv, 1);
     cmd_FreeArgv(targv);
+    return(0);
 }
 
 statusWatcher()
index ea34da5..cadd173 100644 (file)
@@ -80,7 +80,6 @@ bc_EvalVolumeSet(aconfig, avs, avols, uclient)
      struct ubik_client *uclient;
 {                              /*bc_EvalVolumeSet */
     int code;
-    int a, b, c;
     static afs_int32 use = 2;
 
     if (use == 2) {            /* Use EvalVolumeSet2() */
@@ -166,7 +165,7 @@ randSPEntries(serverlist, avols)
      struct serversort *serverlist;
      struct bc_volumeDump **avols;
 {
-    struct serversort *ss, **pss, *tss;
+    struct serversort *ss, **pss;
     struct partitionsort *ps, **pps;
     afs_int32 r;
     afs_int32 scount, pcount;
@@ -220,8 +219,8 @@ EvalVolumeSet2(aconfig, avs, avols, uclient)
     struct bc_volumeDump *tvd;
     afs_int32 code = 0, tcode;
     afs_int32 count = 0;
-    struct serversort *servers = 0, *lastserver = 0, *ss = 0, *nss;
-    struct partitionsort *ps = 0, *nps;
+    struct serversort *servers = 0, *lastserver = 0, *ss = 0;
+    struct partitionsort *ps = 0;
 
     *avols = (struct bc_volumeDump *)0;
     bulkentries.nbulkentries_len = 0;
@@ -833,7 +832,6 @@ bc_GetTapeStatusCmd(as, arock)
      char *arock;
 {
     afs_int32 code;
-    afs_int32 index, dumpID;
     struct rx_connection *tconn;
     afs_int32 portOffset = 0;
 
@@ -902,8 +900,6 @@ bc_WaitForNoJobs()
     int usefulJobRunning = 1;
 
     extern dlqlinkT statusHead;
-    statusP ptr;
-    dlqlinkP dptr;
 
     com_err(whoami, 0, "waiting for job termination");
 
@@ -933,9 +929,7 @@ bc_JobsCmd(as, arock)
      struct cmd_syndesc *as;
      char *arock;
 {
-    int i;
     afs_int32 prevTime;
-    struct bc_dumpTask *td;
     dlqlinkP ptr;
     statusP statusPtr;
     char ds[50];
@@ -1056,7 +1050,6 @@ bc_KillCmd(as, arock)
     struct bc_dumpTask *td;
     char *tp;
     char tbuffer[256];
-    afs_int32 code;
 
     dlqlinkP ptr;
     statusP statusPtr;
@@ -1151,7 +1144,7 @@ bc_VolRestoreCmd(as, arock)
     int oldFlag;
     afs_int32 fromDate;
     char *newExt, *timeString;
-    afs_int32 i, portRemain;
+    afs_int32 i;
     afs_int32 *ports = NULL;
     afs_int32 portCount = 0;
     int dontExecute;
@@ -1618,7 +1611,6 @@ bc_DumpCmd(as, arock)
     struct bc_volumeSet *tvs;  /*Ptr to list of generated volume info */
     struct bc_dumpSchedule *tds, *baseds;      /*Ptr to dump schedule node */
     struct bc_volumeDump *tve, *volsToDump;    /*Ptr to individual vols to be dumped */
-    struct bc_volumeDump *ntve, *tves, *ptves, *rtves;
     struct budb_dumpEntry dumpEntry, de, fde;  /* dump entry */
     afs_uint32 d;
 
@@ -1635,11 +1627,7 @@ bc_DumpCmd(as, arock)
     afs_int32 code;            /* Return code */
     int loadfile;              /* whether to load a file or not */
 
-    struct bc_dumpTask *dumpTaskPtr;   /* for dump thread */
-    afs_int32 dumpTaskSlot;
-    char *junk;
     statusP statusPtr;
-    int r, nservers, ns, serverfound;
 
     extern struct bc_dumpTask bc_dumpTasks[];
     extern afs_int32 bcdb_FindLastVolClone();
@@ -2443,7 +2431,6 @@ bc_deleteDumpCmd(as, arock)
     budb_dumpsList dumps, flags;
     int i;
     afs_int32 port = -1, dbonly = 0, force;
-    afs_uint32 taskid;
 
     /* Must specify at least one of -dumpid, -from, or -to */
     if (!as->parms[0].items && !as->parms[1].items && !as->parms[2].items
@@ -2885,7 +2872,6 @@ dumpInfo(dumpid, detailFlag)
     budb_volumeList vl;
     afs_int32 last, next, dbTime;
     afs_int32 tapedumpid;
-    afs_int32 numTapes;
 
     int tapeNumber;
     int i;
index f2addf9..43883ae 100644 (file)
@@ -71,7 +71,6 @@ bc_InitConfig(apath)
      char *apath;
 {
     register struct bc_config *tb;
-    register struct bc_hostEntry *the;
 
     /* initialize global config structure */
     tb = (struct bc_config *)malloc(sizeof(struct bc_config));
index e7d6478..1e526a6 100644 (file)
@@ -114,6 +114,7 @@ dlqMoveb(fromptr, toptr)
 
     fromptr->dlq_next = fromptr;
     fromptr->dlq_prev = fromptr;
+    return (0);
 }
 
 /* dlqUnlinkb
index 7366216..aa954da 100644 (file)
@@ -390,7 +390,7 @@ bc_CreateDumpSchedule(aconfig, adumpName, expDate, expType)
      afs_int32 expDate;
      afs_int32 expType;
 {
-    register struct bc_dumpSchedule **tlast, *tdump;
+    register struct bc_dumpSchedule *tdump;
     struct bc_dumpSchedule *parent, *node;
     afs_int32 code;
 
@@ -517,7 +517,7 @@ bc_DeleteDumpSchedule(aconfig, adumpName)
 bc_ProcessDumpSchedule(aconfig)
      register struct bc_config *aconfig;
 {
-    register struct bc_dumpSchedule *tds, *uds;
+    register struct bc_dumpSchedule *tds;
     struct bc_dumpSchedule *parentptr, *nodeptr;
     int retval;
 
index 6c7deac..2682bd9 100644 (file)
@@ -68,10 +68,8 @@ extern afs_int32 lastTaskCode;
 bc_Dumper(aindex)
 {
     struct rx_connection *tconn;
-    struct tc_dumpStat dumpStat;
     register struct bc_volumeDump *tde;
     afs_int32 count, port;
-    struct timeval tv;
     struct tc_dumpDesc *volDesc = 0;
     struct tc_dumpArray volArray;
     char *baseNamePtr;
@@ -268,8 +266,6 @@ bc_StartDmpRst(aconfig, adname, avname, avolsToDump, adestServer,
     register int i;
     register afs_int32 code;
     char *junk;
-    int doit;
-    struct bc_volumeDump *tvol, *temp;
 
     for (i = 0; i < BC_MAXSIMDUMPS; i++)
        if (!(bc_dumpTasks[i].flags & BC_DI_INUSE))
index 6327a04..fcf76f7 100644 (file)
@@ -64,10 +64,9 @@ bc_AddDumpCmd(as, arock)
      char *arock;
 {
     register char *dname;      /* dump schedule name */
-    char *dateString;          /* expiration date */
     register afs_int32 code;
     afs_int32 expType, expDate;
-    register struct cmd_item *ti, *expItem;
+    register struct cmd_item *ti;
     udbClientTextP ctPtr;
 
     afs_int32 bc_ParseExpiration();
index adfffea..3424f7a 100644 (file)
@@ -333,7 +333,6 @@ static int
 MyBeforeProc(as)
      register struct cmd_syndesc *as;
 {
-    char *rock;
     afs_int32 code;
 
     /* Handling the command line opcode */
@@ -391,11 +390,11 @@ struct Lock dispatchLock; /* lock on the Dispatch call */
 
 afs_int32
 doDispatch(targc, targv, dispatchCount)
-     char **targv[MAXV];
+     char *targv[MAXV];
      afs_int32 targc;
      afs_int32 dispatchCount;  /* to prevent infinite recursion */
 {
-    char **sargv[MAXV];
+    char *sargv[MAXV];
     afs_int32 sargc;
     afs_int32 code, c;
     FILE *fd;
@@ -489,10 +488,9 @@ main(argc, argv)
      int argc;
      char **argv;
 {                              /*main */
-    char **targv[MAXV];                /*Ptr to parsed argv stuff */
+    char *targv[MAXV];         /*Ptr to parsed argv stuff */
     afs_int32 targc;           /*Num parsed arguments */
     afs_int32 code;            /*Return code */
-    char *tp;                  /*Result of gets() */
     register struct cmd_syndesc *ts;   /*Ptr to parsed command line */
     int i;
 
index 61570ec..d57e498 100644 (file)
@@ -71,6 +71,7 @@ unlock_cmdLine()
 
 /* general */
 
+void
 clearStatus(taskId, flags)
      afs_uint32 taskId;
      afs_uint32 flags;
@@ -141,6 +142,7 @@ findStatus(taskId)
     return (ptr);
 }
 
+void
 setStatus(taskId, flags)
      afs_uint32 taskId;
      afs_uint32 flags;
index a572cd3..20deb4c 100644 (file)
@@ -511,7 +511,7 @@ bcdb_UseTape(teptr, newFlag)
 bcdb_GetTextFile(register udbClientTextP ctPtr)
 {
     afs_int32 bufferSize;
-    afs_int32 offset, nextOffset, chunkSize;
+    afs_int32 offset, nextOffset;
     charListT charList;
     afs_int32 code = 0;
 
@@ -965,8 +965,6 @@ udbClientInit(noAuthFlag, localauth, cellName)
      int localauth;
      char *cellName;
 {
-    afs_int32 serverList[MAXSERVERS];
-    char hostname[256];
     struct ktc_principal principal;
     struct ktc_token token;
     struct afsconf_cell info;
@@ -1357,7 +1355,7 @@ udbLocalInit()
        return (code);
     }
 
-  abort:
+   /* abort: */
     return (0);
 }
 
index 10332ff..f9f66cf 100644 (file)
@@ -65,7 +65,6 @@ bc_AddVolEntryCmd(as, arock)
     char *volSetName, *serverName, *partitionName, *volRegExp;
     udbClientTextP ctPtr;
     struct bc_volumeSet *tset;
-    afs_int32 flags;
 
     volSetName = as->parms[0].items->data;
     serverName = as->parms[1].items->data;
@@ -396,11 +395,8 @@ bc_ListVolSetCmd(as, arock)
 
 bc_ClearVolumeSets()
 {
-    udbClientTextP ctPtr;
     struct udbHandleS *uhptr = &udbHandle;
     struct bc_volumeSet *vsPtr, *vsNextPtr, **vsPrev;
-    struct bc_volumeEntry *vePtr, *veNextPtr;
-    afs_int32 code;
 
     extern struct bc_config *bc_globalConfig;
 
@@ -673,7 +669,6 @@ bc_SaveVolumeSet()
 afs_int32
 bc_UpdateVolumeSet()
 {
-    struct bc_dumpSchedule *dumpPtr, *nextDumpPtr;
     struct udbHandleS *uhptr = &udbHandle;
     udbClientTextP ctPtr;
     afs_int32 code;
index 3dc0dbb..3ebdd7f 100644 (file)
@@ -671,6 +671,8 @@ ht_KeyMatch(type, key, e)
     default:
        db_panic("illegal hash function");
     }
+    /* not reached */
+    return 0;
 }
 
 /* ht_LookupEntry
@@ -1217,7 +1219,6 @@ scanHashTable(ut, mhtPtr, selectFn, operationFn, rockPtr)
     int tableLength;           /* # entries */
     int blockLength;           /* # blocks */
     int hashIndex;
-    int blockIndex, entryIndex;
     int old;
     int i;
     afs_int32 code = 0;
index 6637856..a9cabc8 100644 (file)
@@ -544,7 +544,6 @@ mkstemp(st)
     retval = open(mktemp(st), O_RDWR | O_CREAT | O_EXCL, 0600);
 #endif
 
-  error_exit:
     return (retval);
 }
 #endif
index dac5d59..9787c3d 100644 (file)
@@ -561,9 +561,8 @@ verifyVolInfoEntry(ut, volInfoAddr, ai, ao, volInfo)
      struct volInfo *volInfo;
 {
     int volCount = 0, ccheck = 1;
-    int nFrags;
     afs_int32 volFragAddr;
-    int blockIndex, entryIndex, bindex, eindex;
+    int blockIndex, entryIndex;
     struct volFragment volFragment;
     afs_int32 code = 0, tcode;
 
@@ -1268,7 +1267,7 @@ verifyDatabase(ut, recreateFile)
      FILE *recreateFile;       /* not used */
 {
     afs_int32 eof;
-    int j, bmsize;
+    int bmsize;
     afs_int32 code = 0, tcode;
 
     extern int nBlocks;                /* no. blocks in database */
index d7c17da..e702314 100644 (file)
@@ -3654,7 +3654,6 @@ T_DumpDatabase(call, filename)
     char *path = 0;
     dbadr dbAddr;
     int type, old, length, hash;
-    int block = 0, index = 0;
     struct memoryHashTable *mht;
     afs_int32 eval, code = 0;
 
@@ -3704,8 +3703,8 @@ T_DumpDatabase(call, filename)
                                ERROR(eval);
 
                            fprintf(dumpfid,
-                                   "\ndumpId hash %d, entry at %u: block %d, index %d\n",
-                                   hash, dbAddr, block, index);
+                                   "\ndumpId hash %d, entry at %u\n",
+                                   hash, dbAddr);
                            fprintf(dumpfid,
                                    "----------------------------\n");
                            dump_ntoh(&diskDump, &hostDump);
@@ -3725,8 +3724,8 @@ T_DumpDatabase(call, filename)
                                ERROR(eval);
 
                            fprintf(dumpfid,
-                                   "\ndumpname hash %d, entry at %u: block %d, index %d\n",
-                                   hash, dbAddr, block, index);
+                                   "\ndumpname hash %d, entry at %u\n",
+                                   hash, dbAddr);
                            fprintf(dumpfid,
                                    "----------------------------\n");
                            dump_ntoh(&diskDump, &hostDump);
@@ -3746,8 +3745,8 @@ T_DumpDatabase(call, filename)
                                ERROR(eval);
 
                            fprintf(dumpfid,
-                                   "\ntapename hash %d, entry at %u: block %d, index %d\n",
-                                   hash, dbAddr, block, index);
+                                   "\ntapename hash %d, entry at %u\n",
+                                   hash, dbAddr);
                            fprintf(dumpfid,
                                    "----------------------------\n");
                            tape_ntoh(&diskTape, &hostTape);
@@ -3767,8 +3766,8 @@ T_DumpDatabase(call, filename)
                                ERROR(eval);
 
                            fprintf(dumpfid,
-                                   "\nvolname hash %d, entry at %u: block %d, index %d\n",
-                                   hash, dbAddr, block, index);
+                                   "\nvolname hash %d, entry at %u\n",
+                                   hash, dbAddr);
                            fprintf(dumpfid,
                                    "----------------------------\n");
                            volInfo_ntoh(&diskVolInfo, &hostVolInfo);
@@ -3817,8 +3816,7 @@ volFragsDump(ut, dumpfid, dbAddr)
            return (0);
        }
 
-       fprintf(dumpfid, "\nvolfragment entry at %u: block %d, index %d\n",
-               dbAddr, 0, 0);
+       fprintf(dumpfid, "\nvolfragment entry at %u\n", dbAddr);
        fprintf(dumpfid, "----------------------------\n");
        volFragment_ntoh(&diskVolFragment, &hostVolFragment);
        printVolFragment(dumpfid, &hostVolFragment);
index 595df24..f67fb83 100644 (file)
@@ -1130,7 +1130,6 @@ Dumper(struct dumpNode *nodePtr)
     afs_int32 code = 0;
 
     /* for volume setup */
-    struct tc_dumpDesc *dumpDescPtr;
     int i;
     int failedvolumes = 0;
     int dumpedvolumes = 0;
@@ -1520,11 +1519,10 @@ getDumpTape(struct dumpRock *dparamsPtr, int interactiveFlag,
     struct budb_dumpEntry dumpEntry;
     struct budb_tapeEntry tapeEntry;
     struct budb_volumeEntry volEntry;
-    Date oldTapeExpiration, expir;
-    afs_int32 curTime;
+    Date expir;
     afs_int32 doAppend;
     afs_int32 code = 0;
-    int askForTape, opcode;
+    int askForTape;
     int tapecount = 1;
     char strlevel[5];
     afs_int32 tapepos, lastpos;
@@ -1644,10 +1642,9 @@ getDumpTape(struct dumpRock *dparamsPtr, int interactiveFlag,
        } else {                /* not appending */
 
            afs_uint32 tapeid;
-           afs_uint32 dmp, parent;
+           afs_uint32 dmp;
            struct budb_dumpEntry de, de2;
 
-
            /* Check if tape name is not what expected - null tapes are acceptable
             * Don't do check if the tape has a user defined label.
             */
@@ -1877,7 +1874,7 @@ makeVolumeHeader(struct volumeHeader *vhptr, struct dumpRock *dparamsPtr,
     strcpy(vhptr->dumpSetName, nodePtr->dumpSetName);
     strcpy(vhptr->preamble, "H++NAME#");
     strcpy(vhptr->postamble, "T--NAME#");
-  error_exit:
+  
     return (code);
 }
 
index 41ec5d5..83b2233 100644 (file)
@@ -402,6 +402,7 @@ GetResponseKey(int seconds, char *key)
         * * notes:
         * *     only external clients are in recoverDb.c. Was static. PA
         */
+void
 FFlushInput()
 {
     int w;
@@ -436,8 +437,6 @@ callOutRoutine(taskId, tapePath, flag, name, dbDumpId, tapecount)
      afs_uint32 dbDumpId;
      int tapecount;
 {
-    afs_int32 count;
-
     afs_int32 code = 0;
     int pid;
 
@@ -551,7 +550,6 @@ unmountTape(taskId, tapeInfoPtr)
      struct butm_tapeInfo *tapeInfoPtr;
 {
     afs_int32 code;
-    afs_int32 wcode;
     int cpid, status, rcpid;
 
     code = butm_Dismount(tapeInfoPtr);
@@ -741,8 +739,7 @@ PromptForTape(flag, name, dbDumpId, taskId, tapecount)
                com_err(whoami, errno,
                        "Error waiting for callout script to terminate.");
                TLog(taskId,
-                    "Can't get exit status from callout script. will prompt\n",
-                    wcode);
+                    "Can't get exit status from callout script. will prompt\n");
                CallOut = 0;
                break;
            }
@@ -1245,8 +1242,7 @@ restoreVolumeData(call, rparamsPtr)
 {
     afs_int32 curChunk;
     afs_uint32 totalWritten = 0;
-    afs_uint32 tapeID;
-    afs_int32 code, tcode;
+    afs_int32 code;
     afs_int32 headBytes, tailBytes, w;
     afs_int32 taskId;
     afs_int32 nbytes;          /* # bytes data in last tape block read */
@@ -1478,8 +1474,9 @@ xbsaRestoreVolume(taskId, restoreInfo, rparamsPtr)
      struct tc_restoreDesc *restoreInfo;
      struct restoreParams *rparamsPtr;
 {
-    afs_int32 code = 0, rc;
+    afs_int32 code = 0;
 #ifdef xbsa
+    afs_int32 rc;
     afs_int32 newServer, newPart, newVolId;
     char *newVolName;
     int restoreflags, havetrans = 0, startread = 0;
@@ -1675,7 +1672,6 @@ restoreVolume(taskId, restoreInfo, rparamsPtr)
     int restoreflags;
     afs_uint32 tapeID;
     struct butm_tapeInfo *tapeInfoPtr = rparamsPtr->tapeInfoPtr;
-    struct budb_dumpEntry dumpEntry;
 
     /* Check if we need a tape and prompt for one if so */
     tapeID =
@@ -1745,15 +1741,13 @@ restoreVolume(taskId, restoreInfo, rparamsPtr)
 Restorer(newNode)
      struct dumpNode *newNode;
 {
-    afs_int32 code = 0, tcode, rc;
+    afs_int32 code = 0, tcode;
     afs_uint32 taskId;
-    afs_uint32 dumpID;
     char *newVolName;
     struct butm_tapeInfo tapeInfo;
     struct tc_restoreDesc *Restore;
     struct tc_restoreDesc *RestoreDesc;
     struct restoreParams rparams;
-    int restoreflags;
     afs_int32 allocbufferSize;
     time_t startTime, endTime;
     afs_int32 goodrestore = 0;
@@ -1870,7 +1864,7 @@ Restorer(newNode)
        unmountTape(taskId, &tapeInfo);
     } else {
 #ifdef xbsa
-       rc = InitToServer(taskId, &butxInfo, 0);        /* Return to original server */
+       code = InitToServer(taskId, &butxInfo, 0);      /* Return to original server */
 #endif
     }
 
@@ -2001,7 +1995,6 @@ FindVolTrailer(buffer, size, dSize, volTrailerPtr)
      afs_int32 *dSize;         /* dataSize */
 {
     afs_int32 offset, s;
-    afs_int32 code;
     int found;
 
     *dSize = size;
index bf9b11b..8186135 100644 (file)
@@ -533,13 +533,10 @@ readDump(taskId, tapeInfoPtr, scanInfoPtr)
     int moreTapes = 1;
     afs_int32 nbytes, flags, seq;
     int newDump = 1, newTape = 1;
-    afs_int32 tapePosition, c;
+    afs_int32 tapePosition;
     afs_int32 code = 0, tcode;
-    int interactiveFlag, badscan;
-
+    int badscan;
     struct volumeHeader volHeader, volTrailer;
-
-    int good;
     struct budb_tapeEntry tapeEntry;
     struct budb_volumeEntry volEntry;
 
index d5a26a0..ed4d44b 100644 (file)
@@ -268,7 +268,6 @@ stringReplace(name)
      char *name;
 {
     char *pos;
-    int i;
     char buffer[256];
 
     pos = strrchr(name, '/');
@@ -855,7 +854,6 @@ WorkerBee(as, arock)
      struct cmd_syndesc *as;
      char *arock;
 {
-    char *pid;
     register afs_int32 code;
     struct rx_securityClass *(securityObjects[3]);
     struct rx_service *service;
@@ -864,7 +862,6 @@ WorkerBee(as, arock)
     int localauth;
     /*process arguments */
     afs_int32 portOffset = 0;
-    afs_int32 logIOName;
 #ifdef AFS_PTHREAD_ENV
     pthread_t dbWatcherPid;
     pthread_attr_t tattr;
@@ -978,8 +975,9 @@ WorkerBee(as, arock)
     if (centralLogFile) {
        struct stat sbuf;
        afs_int32 statcode;
+#ifdef AFS_NT40_ENV
        char path[AFSDIR_PATH_MAX];
-
+#endif
        statcode = stat(centralLogFile, &sbuf);
        centralLogIO = fopen(centralLogFile, "a");
        if (!centralLogIO) {
index 299cdc4..dcb54bd 100644 (file)
@@ -46,19 +46,6 @@ extern afs_int32 xbsaType;
 callPermitted(call)
      struct rx_call *call;
 {
-    afs_int32 code;
-
-    struct rx_connection *tconn;
-    rxkad_level level;
-    Date expiration;
-    char name[MAXKTCNAMELEN];
-    char inst[MAXKTCNAMELEN];
-    char celn[MAXKTCREALMLEN];
-    afs_int32 kvno;
-
-    char *cell;
-    afs_int32 flag;
-
     /* before this code can be used, the rx connection, on the bucoord side, must */
     /* be changed so that it will set up for token passing instead of using  a    */
     /* simple rx connection that, below, returns a value of 0 from rx_SecurityClassOf */
@@ -83,7 +70,6 @@ STC_LabelTape(acid, label, taskId)
 #else
     PROCESS pid;
 #endif
-    struct tc_tapeLabel *mylabel;
     struct labelTapeIf *ptr;
     statusP statusPtr;
     afs_int32 code;
@@ -627,6 +613,7 @@ STC_DeleteDump(acid, dumpID, taskId)
     struct deleteDumpIf *ptr = 0;
     statusP statusPtr = 0;
     afs_int32 code = TC_BADTASK;       /* If not compiled -Dxbsa then fail */
+#ifdef xbsa
 #ifdef AFS_PTHREAD_ENV
     pthread_t pid;
     pthread_attr_t tattr;
@@ -634,6 +621,7 @@ STC_DeleteDump(acid, dumpID, taskId)
 #else
     PROCESS pid;
 #endif
+#endif
     extern afs_int32 DeleteDump();
     extern statusP createStatusNode();
     extern afs_int32 allocTaskId();
index 452a4b8..42f8a67 100644 (file)
@@ -110,7 +110,6 @@ GetDBTape(taskId, expires, tapeInfoPtr, dumpid, sequence, queryFlag,
     int interactiveFlag;
     char tapeName[BU_MAXTAPELEN];
     char strlevel[5];
-    afs_int32 i;
     struct timeval tp;
     struct timezone tzp;
     afs_int32 curTime;
@@ -377,14 +376,11 @@ saveDbToTape(saveDbIfPtr)
     afs_int32 code = 0;
     afs_int32 i;
     int wroteLabel;
-    afs_int32 new;
     afs_uint32 taskId;
     Date expires;
 
     struct butm_tapeInfo tapeInfo;
     struct budb_dumpEntry dumpEntry;
-    struct tapeEntryList *next;
-    struct budb_dumpEntry de;
 
     extern struct deviceSyncNode *deviceLatch;
     extern struct tapeConfig globalTapeConfig;
@@ -512,8 +508,6 @@ makeDbDumpEntry(tapeEntPtr, dumpEntryPtr)
      struct budb_tapeEntry *tapeEntPtr;
      struct budb_dumpEntry *dumpEntryPtr;
 {
-    afs_int32 code;
-
     memset(dumpEntryPtr, 0, sizeof(struct budb_dumpEntry));
 
     dumpEntryPtr->id = tapeEntPtr->dump;
@@ -548,7 +542,7 @@ readDbTape(tapeInfoPtr, rstTapeInfoPtr, query)
 {
     afs_int32 code = 0;
     int interactiveFlag;
-    afs_int32 taskId, i;
+    afs_int32 taskId;
     struct butm_tapeLabel oldTapeLabel;
     char AFStapeName[BU_MAXTAPELEN], tapeName[BU_MAXTAPELEN];
     struct tapeEntryList *endList;
@@ -667,8 +661,7 @@ restoreDbFromTape(taskId)
      afs_uint32 taskId;
 {
     afs_int32 code = 0;
-    afs_int32 new, i;
-    struct dumpNode *node;
+    afs_int32 i;
     struct butm_tapeInfo tapeInfo;
     struct rstTapeInfo rstTapeInfo;
     struct budb_dumpEntry dumpEntry;
@@ -820,7 +813,7 @@ writeDbDump(tapeInfoPtr, taskId, expires, dumpid)
     afs_int32 chunksize = 0;
     afs_int32 tc_EndMargin, tc_KEndMargin, kRemaining;
     int sequence;
-    int wroteLabel, new;
+    int wroteLabel;
     int firstcall;
 #ifdef AFS_PTHREAD_ENV
     pthread_t alivePid;
@@ -1208,9 +1201,9 @@ restoreDbDump(tapeInfo, rstTapeInfoPtr, nextHeader)
     struct budb_tapeEntry netTapeEntry, hostTapeEntry;
     struct budb_volumeEntry netVolumeEntry, hostVolumeEntry;
     struct structDumpHeader netItemHeader;
-    afs_int32 newTape, taskId;
+    afs_int32 taskId;
     int restoreThisDump = 1;
-    afs_int32 code = 0, tcode;
+    afs_int32 code = 0;
 
     extern struct udbHandleS udbHandle;
 
index 0b2193c..2b3cac7 100644 (file)
@@ -652,8 +652,6 @@ incPosition(info, fid, dataSize)
      usd_handle_t fid;
      afs_uint32 dataSize;
 {
-    afs_hyper_t off;
-
     /* Add this to the amount of data written to the tape */
     incSize(info, dataSize);
 
@@ -663,6 +661,7 @@ incPosition(info, fid, dataSize)
        info->posCount = 0;
 #if (defined(AFS_SUN_ENV) || defined(AFS_DEC_ENV) || defined(AFS_LINUX24_ENV))
        if (!isafile) {
+        afs_hyper_t off;
            hset64(off, 0, 0);
            USD_IOCTL(fid, USD_IOCTL_SETSIZE, &off);
        }
@@ -728,8 +727,6 @@ SeekFile(info, count)
      int count;
 {
     afs_int32 code = 0;
-    afs_int32 fcode;
-    int cpid, status, rcpid, stat;
     struct progress *p;
     afs_int32 error = 0;
 
@@ -972,9 +969,7 @@ rewindFile(info)
      struct butm_tapeInfo *info;
 {
     struct progress *p;
-    int cpid, status, rcpid, stat;
     afs_int32 code = 0;
-    afs_int32 rwcode;
     afs_int32 error;
 
     p = (struct progress *)info->tmRock;
@@ -1013,7 +1008,7 @@ file_Mount(info, tape)
     struct progress *p;
     char filename[64];
     usd_handle_t fid;
-    int cpid, status, rcpid, xflags;
+    int xflags;
     afs_int32 code = 0, error = 0, rc = 0;
 
     if (info->debug)
@@ -1096,11 +1091,7 @@ file_Dismount(info)
      struct butm_tapeInfo *info;
 {
     struct progress *p;
-    int cpid, status, rcpid, stat;
-    afs_int32 code = 0, error = 0, cd;
-    afs_int32 clcode;
-    int fd[2];
-    char c;
+    afs_int32 code = 0, error = 0;
 
     if (info->debug)
        printf("butm: Unmount tape drive\n");
@@ -1356,7 +1347,6 @@ static afs_int32
 file_ReadFileBegin(info)
      struct butm_tapeInfo *info;
 {
-    struct fileMark mark;
     afs_int32 code = 0;
     afs_int32 blockType;
 
@@ -1539,7 +1529,6 @@ static afs_int32
 file_ReadFileEnd(info)
      struct butm_tapeInfo *info;
 {
-    struct fileMark mark;
     afs_int32 code = 0;
     afs_int32 blockType;
 
@@ -1666,7 +1655,6 @@ file_SeekEODump(info, position)
      struct butm_tapeInfo *info;
      afs_int32 position;
 {
-    struct fileMark mark;
     afs_int32 code = 0;
     afs_int32 blockType;
     afs_int32 w;
index 271bcc8..f361fd7 100644 (file)
@@ -414,7 +414,6 @@ PerformDumpTest(TestInfo * tip)
     if ((info.status & BUTM_STATUS_EOD) == 0) {
        code = butm_ReadFileBegin(&info);
        if (code && (code != BUTM_EOD)) {
-         should_eot:
            com_err(whoami, code, "Should have encountered an 'End Of Tape'");
            ERROR_EXIT(8);
        }
index 74eada8..39d1561 100644 (file)
@@ -308,7 +308,6 @@ gencurdir(char *val)
 int
 isequal(char *msg1, char *msg2, char *disp)
 {
-    int x;
     strlwr(msg1);
     strlwr(msg2);
     if (strcmp(msg1, msg2) != 0)
@@ -320,7 +319,6 @@ isequal(char *msg1, char *msg2, char *disp)
 int
 SetSysEnv(int argc, char *argv[])
 {
-    long ret;
     DWORD dwResult;
     printf("assignment %s %s\n", argv[2], argv[3]);
     Addkey("HKEY_LOCAL_MACHINE",
index 3cb0151..2f7b0f5 100644 (file)
@@ -72,6 +72,7 @@ $(LIBFILE): $(LIBOBJS)
 #####################
 
 GENERATED_FILES = \
+    $(VERSFILE).c \
        key_perm.h \
        p_table.h \
        s_table.h \
index a6d996a..263ed22 100644 (file)
@@ -1257,7 +1257,7 @@ int
 MyAfterProc(struct cmd_syndesc *as)
 {
     if (!strcmp(as->name, "help"))
-       return;
+       return 0;
 
     /* Determine if we need to destory the ubik connection.
      * Closing it avoids resends of packets. 
@@ -1287,7 +1287,6 @@ static int
 MyBeforeProc(struct cmd_syndesc *as, char *arock)
 {
     extern struct passwd *getpwuid();
-    struct passwd *pw;
     struct ktc_encryptionKey key;
     struct ktc_principal auth_server, auth_token, client;
     char realm[MAXKTCREALMLEN];
@@ -1349,7 +1348,7 @@ MyBeforeProc(struct cmd_syndesc *as, char *arock)
            }
 #else
            /* No explicit name provided: use Unix uid. */
-           pw = getpwuid(getuid());
+           struct passwd pw = getpwuid(getuid());
            if (pw == 0) {
                printf("Can't figure out your name from your user id.\n");
                return KABADCMD;
index 6b2b72b..aef045d 100644 (file)
@@ -130,7 +130,7 @@ kaux_write(afs_int32 to, unsigned int nfailures, afs_uint32 lasttime)
     if ((write(fd, &nfailures, sizeof(int)) != sizeof(int))
        || (write(fd, &lasttime, sizeof(afs_int32)) != sizeof(afs_int32)))
        perror("kaux_write()");
-
+    return 0;
 }
 
 
index be0a8a1..3f6f8f3 100644 (file)
@@ -611,7 +611,7 @@ ka_DelKey(tt, tentryaddr, tentry)
      afs_int32 tentryaddr;
      struct kaentry *tentry;
 {
-    int code, i;
+    int code;
     struct kaOldKeys okeys;    /* old keys block */
     afs_int32 okeysaddr, nextaddr;     /* offset of old keys block */
     afs_int32 prevptr = 0;
@@ -682,7 +682,6 @@ ka_debugKeyCache(info)
        if (keyCache[i].used) {
            if (info->kcUsed < KADEBUGKCINFOSIZE) {
                int j = info->kcUsed;
-               int k;
                char principal[sizeof(keyCache[0].name) +
                               sizeof(keyCache[0].inst)];
 
@@ -692,8 +691,11 @@ ka_debugKeyCache(info)
                    (keyCache[i].superseded == NEVERDATE);
                info->kcInfo[j].keycksum = 0;
 #if DEBUG_KEY_CACHE
+        {
+        int k;
                for (k = 0; k < sizeof(struct ktc_encryptionKey); k++)
                    info->kcInfo[j].keycksum += ((char *)&keyCache[i].key)[k];
+        }
 #endif
                strcpy(principal, keyCache[i].name);
                strcat(principal, ".");
@@ -708,6 +710,7 @@ ka_debugKeyCache(info)
 
 /* Add a key to the key cache, expanding it if necessary. */
 
+void
 ka_Encache(name, inst, kvno, key, superseded)
      char *name;
      char *inst;
index b568343..01f4bdc 100644 (file)
@@ -1114,7 +1114,6 @@ Authenticate(version, call, aname, ainstance, start, end, arequest, oanswer)
     struct ktc_encryptionKey tgskey;   /* service key for encrypting ticket */
     Date now;
     afs_uint32 pwexpires;
-    afs_uint32 lasttime;
 
     COUNT_REQ(Authenticate);
     if (!name_instance_legal(aname, ainstance))
index d332cf0..26f707d 100644 (file)
@@ -427,4 +427,5 @@ main(argc, argv)
 
     ViceLog(0, ("Starting to process AuthServer requests\n"));
     rx_ServerProc();           /* donate this LWP */
+    return 0;
 }
index 965fc64..8d5cd9f 100644 (file)
@@ -2257,8 +2257,6 @@ SetUserAccess(const pts_UserUpdateEntry_p userP, afs_int32 * flags,
     }
     rc = 1;
 
-  fail_SetUserAccess:
-
     if (st != NULL) {
        *st = tst;
     }
index 8d9ffc7..8465588 100644 (file)
@@ -292,7 +292,7 @@ static int FDSetCmp(int nfds, fd_set *fd_set1, fd_set *fd_set2)
  */
 static void FDSetSet(int nfds, fd_set *fd_set1, fd_set *fd_set2)
 {
-    unsigned int i, n;
+    unsigned int i;
 
     if (fd_set1 == (fd_set*)0 || fd_set2 == (fd_set*)0)
        return;
@@ -307,8 +307,7 @@ static void FDSetSet(int nfds, fd_set *fd_set1, fd_set *fd_set2)
     if (nfds == 0)
        return;
 
-    n = INTS_PER_FDS(nfds);
-    for (i=0; i<n; i++) {
+    for (i=0,n = INTS_PER_FDS(nfds); i<n; i++) {
        fd_set1->FDS_BITS[i] |= fd_set2->FDS_BITS[i];
     }
 #endif
index a4725c9..4cf7369 100644 (file)
@@ -952,8 +952,8 @@ SPR_UpdateEntry(call, aid, name, uentry)
     struct ubik_trans *tt;
     afs_int32 cid;
     struct prentry tentry;
-    afs_int32 loc, nptr;
-    int count, id = 0;
+    afs_int32 loc;
+    int id = 0;
 
     code = Initdb();
     if (code)
index 5464929..ef9927a 100644 (file)
@@ -195,7 +195,7 @@ CleanUp(as)
 {
 #if defined(SUPERGROUPS)
     if (as && !strcmp(as->name, "help"))
-       return;
+       return 0;
     if (pruclient) {
        /* Need to shutdown the ubik_client & other connections */
        pr_End();
@@ -203,7 +203,7 @@ CleanUp(as)
     }
 #else
     if (!strcmp(as->name, "help"))
-       return;
+       return 0;
     /* Need to shutdown the ubik_client & other connections */
     pr_End();
     rx_Finalize();
@@ -718,7 +718,6 @@ CheckEntry(as)
        printf(".\n");
     }
 
-  done:
     if (lnames.namelist_val)
        free(lnames.namelist_val);
     if (lids.idlist_val)
index ec8fb54..eb8f51a 100644 (file)
@@ -191,12 +191,13 @@ IdCmp(a, b)
      afs_int32 *a;
      afs_int32 *b;
 {
-    if (*a > *b)
+    if (*a > *b) {
        return 1;
-    if (*a == *b)
+    } else if (*a == *b) {
        return 0;
-    if (*a < *b)
+    } else /* (*a < *b) */ {
        return -1;
+    }
 }
 
 static int
@@ -240,6 +241,7 @@ GetGroupLimit(N, x)
     return y;
 }
 
+void
 CreateUser(u)
      int u;
 {
@@ -276,9 +278,9 @@ CreateUser(u)
        ownerUser = id;
        strcpy(ownerUserName, name);
     }
-    return;
 }
 
+void
 CreateGroup(g)
      int g;
 {
@@ -345,7 +347,6 @@ CreateGroup(g)
        lastGroup = id;
        lastGroupPrefix = ownerName;
     }
-    return;
 }
 
 int
@@ -377,6 +378,7 @@ DeleteRandomId(list)
     return -1;                 /* none left */
 }
 
+void
 AddUser(u, g)
      int u, g;
 {
@@ -398,9 +400,9 @@ AddUser(u, g)
        printf("Adding user (%di) to group (%di)\n", ui, gi);
     population[u * number + g]++;
     nAdds++;
-    return;
 }
 
+void
 RemUser(u, g)
      int u, g;
 {
@@ -418,7 +420,6 @@ RemUser(u, g)
        printf("Removing user (%di) from group (%di)\n", ui, gi);
     population[u * number + g]--;
     nRems++;
-    return;
 }
 
 TestManyMembers(as, arock)
@@ -599,7 +600,7 @@ TestManyMembers(as, arock)
     for (u = 0; u < number; u++) {
        afs_int32 ui = users[u];
        if (ui) {
-           int i, j;
+           int i;
            int ng;             /* number groups */
            int (*proc) ();     /* membership listing procedure */
            int over;
@@ -765,6 +766,7 @@ ka_ConvertBytes(ascii, alen, bs, bl)
        }
     }
     *ascii = 0;                        /* terminate string */
+    return 0;
 }
 
 /* This runs various tests on the server.  It creates, then deletes, a bunch of
@@ -931,7 +933,6 @@ MyAfterProc(as, arock)
      struct cmd_syndesc *as;
      char *arock;
 {
-    afs_int32 code;
     if (strlen(tmp_conf_file))
        unlink(tmp_conf_file);
     if (strlen(tmp_cell_file))
index 4999c11..7877d2e 100644 (file)
@@ -482,12 +482,13 @@ IDCmp(a, b)
      afs_int32 *b;
 {
     /* used to sort CPS's so that comparison with acl's is easier */
-    if (*a > *b)
+    if (*a > *b) {
        return 1;
-    if (*a == *b)
+    } else if (*a == *b) {
        return 0;
-    if (*a < *b)
+    } else /* (*a < *b) */ {
        return -1;
+    }
 }
 
 afs_int32
index e77bc14..5a7cfb6 100644 (file)
@@ -82,7 +82,7 @@ RXDLIBS = $(LIBDIR)\afs\afscmd.lib \
          $(LIBDIR)\afs\afsutil.lib \
           $(LIBDIR)\afs\afsreg.lib
 
-$(OUT)\rxdebug.res: rxdebug.rc AFS_component_version_number.h
+$(OUT)\rxdebug.res: rxdebug.rc $(VERSFILE).h
        $(RC) /Fo$*.RES $(*F).rc 
 
 $(OUT)\rxdebug.obj: rxdebug.c
index 3192c8a..85a2600 100644 (file)
@@ -13,5 +13,5 @@
 #define  AFS_VERINFO_NAME "rxdebug"
 #define  AFS_VERINFO_FILENAME "rxdebug.exe"
 
-#include "AFS_component_version_number.h"
+#include "RX_component_version_number.h"
 #include "..\config\NTVersioninfo.rc"
index 23d41eb..68709e3 100644 (file)
@@ -164,6 +164,7 @@ ulock_relLock(atrans)
  */
 
     atrans->locktype = 0;
+    return 0;
 }
 
 /* debugging hooks */
@@ -177,4 +178,5 @@ ulock_Debug(aparm)
        aparm->anyReadLocks = rwlock.readers_reading;
        aparm->anyWriteLocks = ((rwlock.excl_locked == WRITE_LOCK) ? 1 : 0);
     }
+    return 0;
 }
index ea595c6..65acee0 100644 (file)
@@ -17,9 +17,9 @@
 
 #ifdef AFS_NT40_ENV
 /* Compilers complain about empty declaration unless at end of decl's */
-#define AFS_SIGSET_DECL int i_junk
-#define AFS_SIGSET_CLEAR()
-#define AFS_SIGSET_RESTORE()
+#define AFS_SIGSET_DECL int i_junk=0
+#define AFS_SIGSET_CLEAR() ++i_junk
+#define AFS_SIGSET_RESTORE() --i_junk
 #else
 #define AFS_SIGSET_DECL sigset_t i_tset, i_oset
 #ifdef AFS_AIX42_ENV
index 1e6e57e..7da4edf 100644 (file)
@@ -574,7 +574,9 @@ GetRights(struct client *client, struct acl_accessList *ACL,
 {
     extern prlist SystemAnyUserCPS;
     afs_int32 hrights = 0;
+#ifndef AFS_PTHREAD_ENV
     int code;
+#endif
 
     if (acl_CheckRights(ACL, &SystemAnyUserCPS, anyrights) != 0) {
 
@@ -1035,7 +1037,6 @@ CopyOnWrite(Vnode * targetptr, Volume * volptr)
     int wrlen;
     register afs_fsize_t size;
     register int length;
-    int ifd, ofd;
     char *buff;
     int rc;                    /* return code */
     IHandle_t *newH;           /* Use until finished copying, then cp to vnode. */
@@ -4202,7 +4203,7 @@ SAFSS_Symlink(struct rx_call *acall, struct AFSFid *DirFid, char *Name,
     DirHandle dir;             /* Handle for dir package I/O */
     Volume *volptr = 0;                /* pointer to the volume header */
     struct client *client;     /* pointer to client structure */
-    afs_int32 rights, anyrights, fd;   /* rights for this and any user */
+    afs_int32 rights, anyrights;       /* rights for this and any user */
     struct client *t_client;   /* tmp ptr to client data */
     struct in_addr logHostAddr;        /* host ip holder for inet_ntoa */
     FdHandle_t *fdP;
@@ -5896,7 +5897,6 @@ common_GiveUpCallBacks(struct rx_call *acall, struct AFSCBFids *FidArray,
        FS_UNLOCK;
     }
 #endif /* FS_STATS_DETAILED */
-  out:
     return errorCode;
 
 }                              /*common_GiveUpCallBacks */
@@ -5946,7 +5946,6 @@ afs_int32
 SRXAFS_GetCapabilities(struct rx_call * acall, Capabilities * capabilities)
 {
     afs_int32 *dataBuffP;
-    afs_int32 *dataP;
     afs_int32 dataBytes;
 
     dataBytes = 1 * sizeof(afs_int32);
@@ -6391,15 +6390,20 @@ SRXAFS_SetVolumeStatus(struct rx_call * acall, afs_int32 avolid,
 afs_int32
 SRXAFS_GetRootVolume(struct rx_call * acall, char **VolumeName)
 {
+#ifdef notdef
     int fd;
     int len;
     char *temp;
-    int errorCode = 0;         /* error code */
     struct rx_connection *tcon;
+#endif
+    int errorCode = 0;
 #if FS_STATS_DETAILED
     struct fs_stats_opTimingData *opP; /* Ptr to this op's timing struct */
-    struct timeval opStartTime, opStopTime;    /* Start/stop times for RPC op */
+    struct timeval opStartTime;        /* Start time for RPC op */
+#ifdef notdef
+    struct timeval opStopTime;
     struct timeval elapsedTime;        /* Transfer time */
+#endif
 
     /*
      * Set our stats pointer, remember when the RPC operation started, and
@@ -6616,7 +6620,6 @@ FetchData_RXStyle(Volume * volptr, Vnode * targetptr,
 {
     struct timeval StartTime, StopTime;        /* used to calculate file  transfer rates */
     int errorCode = 0;         /* Returned error code to caller */
-    int code;
     IHandle_t *ihP;
     FdHandle_t *fdP;
 #ifdef AFS_NT40_ENV
@@ -6627,10 +6630,6 @@ FetchData_RXStyle(Volume * volptr, Vnode * targetptr,
 #endif /* AFS_NT40_ENV */
     afs_sfsize_t tlen;
     afs_int32 optSize;
-    struct afs_stat tstat;
-#ifdef AFS_AIX_ENV
-    struct statfs tstatfs;
-#endif
 
 #if FS_STATS_DETAILED
     /*
@@ -6845,7 +6844,6 @@ StoreData_RXStyle(Volume * volptr, Vnode * targetptr, struct AFSFid * Fid,
     afs_fsize_t NewLength;     /* size after this store completes */
     afs_sfsize_t adjustSize;   /* bytes to call VAdjust... with */
     int linkCount;             /* link count on inode */
-    int code;
     FdHandle_t *fdP;
     struct in_addr logHostAddr;        /* host ip holder for inet_ntoa */
 
index 83be9eb..09ac9ff 100644 (file)
@@ -766,7 +766,6 @@ MultiBreakCallBack_r(struct cbstruct cba[], int ncbas,
 {
     int i, j;
     struct rx_connection *conns[MAX_CB_HOSTS];
-    int opt_TO;                        /* secs, but internal adaptive parms are in ms */
     static struct AFSCBs tc = { 0, 0 };
 
     assert(ncbas <= MAX_CB_HOSTS);
@@ -878,7 +877,6 @@ BreakCallBack(struct host *xhost, AFSFid * fid, int flag)
     struct CallBack *cb, *nextcb;
     struct cbstruct cba[MAX_CB_HOSTS];
     int ncbas;
-    struct rx_connection *conns[MAX_CB_HOSTS];
     struct AFSCBFids tf;
     int hostindex;
     char hoststr[16];
@@ -1073,7 +1071,6 @@ BreakDelayedCallBacks_r(struct host *host)
     u_byte thead[AFSCBMAX];    /* This should match thead in struct Callback */
     int cbi, first, nfids;
     struct CallBack *cb;
-    struct interfaceAddr interf;
     int code;
     char hoststr[16];
 
@@ -1622,7 +1619,6 @@ GetSomeSpace_r(struct host *hostp, int locked)
 static int
 ClearHostCallbacks_r(struct host *hp, int locked)
 {
-    struct interfaceAddr interf;
     int code;
     int held = 0;
     char hoststr[16];
index 9da6af4..0fba00f 100644 (file)
@@ -87,6 +87,8 @@ struct CEBlock {              /* block of CESPERBLOCK file entries */
     struct client entry[CESPERBLOCK];
 };
 
+static void h_TossStuff_r(register struct host *host);
+
 /*
  * Make sure the subnet macros have been defined.
  */
@@ -532,7 +534,6 @@ h_flushhostcps(register afs_uint32 hostaddr, register afs_uint32 hport)
 struct host *
 h_Alloc_r(register struct rx_connection *r_con)
 {
-    register int code;
     struct servent *serverentry;
     register index = h_HashIndex(rxr_HostOf(r_con));
     register struct host *host;
@@ -691,7 +692,7 @@ h_LookupUuid_r(afsUUID * uuidp)
  * To be called, there must be no holds, and either host->deleted
  * or host->clientDeleted must be set.
  */
-int
+static void
 h_TossStuff_r(register struct host *host)
 {
     register struct client **cp, *client;
@@ -942,7 +943,6 @@ h_GetHost_r(struct rx_connection *tcon)
     struct Identity *identP = NULL;
     afs_int32 haddr;
     afs_int32 hport;
-    int i, j, count;
     char hoststr[16], hoststr2[16];
     Capabilities caps;
 
@@ -1830,7 +1830,6 @@ h_DumpHosts()
 void
 h_GetWorkStats(int *nump, int *activep, int *delp, afs_int32 cutofftime)
 {
-    register int i;
     register struct host *host;
     register int num = 0, active = 0, del = 0;
 
@@ -1892,9 +1891,6 @@ h_ClassifyAddress(afs_uint32 a_targetAddr, afs_uint32 a_candAddr,
                  afs_int32 * a_diffNetworkP)
 {                              /*h_ClassifyAddress */
 
-    register int i;            /*Iterator thru host hash table */
-    register struct host *hostP;       /*Ptr to current host entry */
-    register afs_uint32 currHostAddr;  /*Current host address */
     afs_uint32 targetNet;
     afs_uint32 targetSubnet;
     afs_uint32 candNet;
@@ -2321,7 +2317,6 @@ int
 hashDelete_r(afs_int32 addr, struct host *host)
 {
     int flag;
-    int index;
     register struct h_hashChain **hp, *th;
 
     for (hp = &hostHashTable[h_HashIndex(addr)]; (th = *hp);) {
index f00d3e9..5690321 100644 (file)
@@ -640,7 +640,6 @@ void
 ShutDownAndCore(int dopanic)
 {
     time_t now = time(0);
-    char *tstr;
     char tbuffer[32];
 
     ViceLog(0,
@@ -1307,7 +1306,7 @@ ReadSysIdFile()
 afs_int32
 WriteSysIdFile()
 {
-    afs_int32 fd, nentries, i;
+    afs_int32 fd, i;
     struct versionStamp vsn;
     struct afs_stat status;
     afsUUID uuid;
@@ -1414,9 +1413,7 @@ Do_VLRegisterRPC()
 afs_int32
 InitVL()
 {
-    int (*old) ();
     afs_int32 code;
-    afs_int32 cnt, i;
     extern int rxi_numNetAddrs;
     extern afs_uint32 rxi_NetAddrs[];
 
@@ -1477,14 +1474,12 @@ InitVL()
 int
 main(int argc, char *argv[])
 {
-    int i;
     afs_int32 code;
-    FILE *file;
     char tbuffer[32];
     struct rx_securityClass *sc[4];
     struct rx_service *tservice;
 #ifdef AFS_PTHREAD_ENV
-    pthread_t parentPid, serverPid;
+    pthread_t serverPid;
     pthread_attr_t tattr;
 #else /* AFS_PTHREAD_ENV */
     PROCESS parentPid, serverPid;
index a0f2d65..4869631 100644 (file)
@@ -921,7 +921,7 @@ WorkerBee(as, arock)
     fd = open(dbfile, O_RDONLY, 0);
     if (fd < 0) {
        printf("can't open file '%s'. error = %d\n", dbfile, errno);
-       return;
+       return 0;
     }
 
     /* read the ubik header and the vldb database header */
@@ -929,7 +929,7 @@ WorkerBee(as, arock)
     readheader(&header);
     if (header.vital_header.vldbversion < 3) {
        printf("does not support vldb with version less than 3\n");
-       return;
+       return 0;
     }
 
     maxentries = (header.vital_header.eofPtr / sizeof(vlentry)) + 1;
@@ -1029,6 +1029,7 @@ WorkerBee(as, arock)
                   record[i].type);
        }
     }
+    return 0;
 }
 
 main(argc, argv)
index 6781f19..8b66e57 100644 (file)
@@ -350,7 +350,6 @@ ih_open(IHandle_t * ihP)
 int
 fd_close(FdHandle_t * fdP)
 {
-    FD_t closeFd;
     IHandle_t *ihP;
 
     if (!fdP)
index dc1e219..bd8687d 100644 (file)
@@ -115,8 +115,7 @@ nuke(char *aname, afs_int32 avolid)
     struct afs_stat tstat;
     struct ilist *ti, *ni;
     register afs_int32 code;
-    char *tfile;
-    int i, j, forceSal;
+    int i, forceSal;
     char devName[64], wpath[100];
     char *lastDevComp;
 #ifdef AFS_NAMEI_ENV
@@ -144,12 +143,14 @@ nuke(char *aname, afs_int32 avolid)
     lastDevComp = &aname[strlen(aname) - 1];
     *lastDevComp = toupper(*lastDevComp);
 #else
-    tfile = vol_DevName(tstat.st_dev, wpath);
+    {
+    char *tfile = vol_DevName(tstat.st_dev, wpath);
     if (!tfile) {
        printf("volnuke: can't find %s's device.\n", aname);
        return 1;
     }
     strcpy(devName, tfile);    /* save this from the static buffer */
+    }
     /* aim lastDevComp at the 'foo' of '/dev/foo' */
     lastDevComp = strrchr(devName, '/');
     /* either points at slash, or there is no slash; adjust appropriately */
@@ -200,9 +201,12 @@ nuke(char *aname, afs_int32 avolid)
                }
 #else /* AFS_NAMEI_ENV */
                IH_INIT(fileH, (int)tstat.st_dev, avolid, ti->inode[i]);
-               for (j = 0; j < ti->count[i]; j++) {
-                   code = IH_DEC(fileH, ti->inode[i], avolid);
-               }
+        {
+        int j;
+        for (j = 0; j < ti->count[i]; j++) {
+                  code = IH_DEC(fileH, ti->inode[i], avolid);
+        }
+        }
                IH_RELEASE(fileH);
 #endif /* AFS_NAMEI_ENV */
            }
index 5ed6cbb..2f46a07 100644 (file)
@@ -507,7 +507,7 @@ handleit(struct cmd_syndesc *as)
 {
     register struct cmd_item *ti;
     char pname[100], *temp;
-    afs_int32 seenpart = 0, seenvol = 0, vid = 0, seenany = 0, i;
+    afs_int32 seenpart = 0, seenvol = 0, vid = 0, seenany = 0;
     struct DiskPartition *partP;
 
 #ifdef AFS_SGI_VNODE_GLUE
@@ -519,12 +519,15 @@ handleit(struct cmd_syndesc *as)
 #endif
 
 #ifdef FAST_RESTART
+    {
+    afs_int32 i;
     for (i = 0; i < CMD_MAXPARMS; i++) {
        if (as->parms[i].items) {
            seenany = 1;
            break;
        }
     }
+    }
     if (!seenany) {
        char *msg =
            "Exiting immediately without salvage. Look into the FileLog to find volumes which really need to be salvaged!";
index 4a5217e..33099c1 100644 (file)
@@ -927,8 +927,9 @@ ProcessIndex(Volume * vp, VnodeClass class, afs_int32 ** Bufp, int *sizep,
                    if (vnode->type != vNull && VNDISK_GET_INO(vnode)) {
                        cnt1++;
                        if (DoLogging) {
-                           afs_fsize_t vnodeLength;
-                           Log("RestoreVolume %u Cleanup: Removing old vnode=%u inode=%llu size=%llu\n", V_id(vp), bitNumberToVnodeNumber(i, class), (afs_uintmax_t) VNDISK_GET_INO(vnode), (afs_uintmax_t) vnodeLength);
+                           Log("RestoreVolume %u Cleanup: Removing old vnode=%u inode=%llu size=unknown\n", 
+                     V_id(vp), bitNumberToVnodeNumber(i, class), 
+                     (afs_uintmax_t) VNDISK_GET_INO(vnode));
                        }
                        IH_DEC(V_linkHandle(vp), VNDISK_GET_INO(vnode),
                               V_parentId(vp));
@@ -1467,7 +1468,6 @@ SizeDumpVolume(register struct rx_call *call, register Volume * vp,
               afs_int32 fromtime, int dumpAllDirs,
               register struct volintSize *v_size)
 {
-    struct iod iod;
     int code = 0;
     register struct iod *iodp = (struct iod *)0;
 /*    iod_Init(iodp, call); */
@@ -1488,7 +1488,7 @@ SizeDumpDumpHeader(register struct iod *iodp, register Volume * vp,
 {
     int code = 0;
     int UseLatestReadOnlyClone = 1;
-    afs_int32 dumpTimes[2];
+/*    afs_int32 dumpTimes[2]; */
     afs_uint64 addvar;
 /*    iodp->device = vp->device; */
 /*    iodp->parentId = V_parentId(vp); */
index 5742ed2..ca87c67 100644 (file)
@@ -1177,7 +1177,7 @@ SAFSVolForwardMultiple(struct rx_call *acid, afs_int32 fromTrans, afs_int32
     struct rx_connection **tcons;
     struct rx_call **tcalls;
     struct Volume *vp;
-    int i, nconns, is_incremental;
+    int i, is_incremental;
 
     if (results)
        memset(results, 0, sizeof(manyResults));
@@ -1625,7 +1625,6 @@ afs_int32
 VolListPartitions(struct rx_call *acid, struct pIDs *partIds)
 {
     char namehead[9];
-    int code;
     char i;
 
     strcpy(namehead, "/vicep");        /*7 including null terminator */
index a50d8f6..104a298 100644 (file)
@@ -1149,7 +1149,6 @@ VolumeStats(pntr, entry, server, part, voltype)
      afs_int32 server, part;
 {
     int totalOK, totalNotOK, totalBusy;
-    afs_int32 vcode, vcode2;
 
     DisplayFormat(pntr, server, part, &totalOK, &totalNotOK, &totalBusy, 0, 1,
                  1);
@@ -2084,9 +2083,6 @@ BackupVolume(as)
 
     afs_int32 buvolid, buserver, bupart, butype;
     struct nvldbentry buentry;
-    struct rx_connection *conn;
-    volEntries volInfo;
-    struct nvldbentry store;
 
     avolid = vsu_GetVolumeID(as->parms[0].items->data, cstruct, &err);
     if (avolid == 0) {
@@ -3452,6 +3448,10 @@ GetVolumeInfo(volid, server, part, voltype, rentry)
        *part = rentry->serverPartition[index];
        return 0;
     }
+    fprintf(STDERR,
+            "unexpected volume type for volume %lu\n",
+            (unsigned long)volid);
+    return -1;
 }
 
 static
@@ -3868,7 +3868,6 @@ BackSys(as)
     afs_int32 totalFail = 0;
     int previdx = -1, error, same;
     int comp = 0;
-    char compstr[50];
     struct cmd_item *ti;
     char *ccode;
     int match;
@@ -4416,7 +4415,6 @@ print_addrs(const bulkaddrs * addrs, const afsUUID * m_uuid, int nentries,
 {
     afs_int32 vcode;
     afs_int32 i, j;
-    struct VLCallBack unused;
     afs_int32 *addrp;
     bulkaddrs m_addrs;
     ListAddrByAttributes m_attrs;
@@ -4501,14 +4499,12 @@ ListAddrs(as)
      register struct cmd_syndesc *as;
 {
     afs_int32 vcode;
-    afs_int32 i, j, noresolve = 0, printuuid = 0;
-    struct VLCallBack unused;
-    afs_int32 nentries, *addrp;
-    bulkaddrs addrs, m_addrs;
+    afs_int32 i, noresolve = 0, printuuid = 0;
+    afs_int32 nentries;
+    bulkaddrs m_addrs;
     ListAddrByAttributes m_attrs;
     afsUUID m_uuid, askuuid;
-    afs_int32 m_unique, m_nentries, *m_addrp;
-    afs_int32 base, index;
+    afs_int32 m_unique, m_nentries;
 
     memset(&m_attrs, 0, sizeof(struct ListAddrByAttributes));
     m_attrs.Mask = VLADDR_INDEX;
index 1c8f3cb..568f900 100644 (file)
@@ -1977,10 +1977,8 @@ UV_CopyVolume(afs_int32 afromvol, afs_int32 afromserver, afs_int32 afrompart,
     struct destServer destination;
 
     struct nvldbentry entry, newentry, storeEntry;
-    int i, islocked, pntg;
+    int islocked, pntg;
     afs_int32 error;
-    char in, lf;               /* for test code */
-    int same;
     int justclone = 0;
 
     islocked = 0;
@@ -4473,7 +4471,8 @@ UV_ListPartitions(afs_int32 aserver, struct partList *ptrPartList,
        }
        free(partEnts.partEntries_val);
     }
-  out:
+
+   /* out: */
     if (code)
        fprintf(STDERR,
                "Could not fetch the list of partitions from the server\n");