windows-vol-fix-salvager-20070130
authorJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 30 Jan 2007 12:14:49 +0000 (12:14 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Tue, 30 Jan 2007 12:14:49 +0000 (12:14 +0000)
The salvager on Windows was not being built properly.  The fssync-debug.c
main() was being used instead of the salvager.c main().  Remove
fssync-debug.obj from the library and fixup the includes and global
variable declarations.

src/vol/NTMakefile
src/vol/salvager.c
src/vol/vol-salvage.c
src/vol/vol-salvage.h

index 6396eae..240ea42 100644 (file)
@@ -40,7 +40,6 @@ LIBOBJS =\
        $(OUT)\clone.obj \
        $(OUT)\fssync-client.obj \
        $(OUT)\fssync-server.obj \
-       $(OUT)\fssync-debug.obj \
        $(OUT)\daemon_com.obj \
        $(OUT)\ntops.obj \
        $(OUT)\nuke.obj \
@@ -77,6 +76,7 @@ EXEC_LIBS = \
 SALVAGER = $(DESTDIR)\root.server\usr\afs\bin\salvager.exe
 
 SALVAGER_EXEOBJS =\
+       $(OUT)\salvager.obj \
        $(OUT)\vol-salvage.obj \
        $(OUT)\physio.obj \
        $(OUT)\AFS_component_version_number.obj \
@@ -89,6 +89,20 @@ $(SALVAGER): $(SALVAGER_EXEOBJS) $(EXEC_LIBS)
 
 
 ############################################################################
+# build fssync-debug
+FSSYNC_DEBUG = $(DESTDIR)\root.server\usr\afs\bin\fssync-debug.exe
+
+FSSYNC_DEBUG_EXEOBJS =\
+       $(OUT)\fssync-debug.obj \
+       $(OUT)\AFS_component_version_number.obj \
+       $(OUT)\fssync-debug.res
+
+$(FSSYNC_DEBUG): $(FSSYNC_DEBUG_EXEOBJS) $(EXEC_LIBS)
+       $(EXECONLINK)
+        $(_VC_MANIFEST_EMBED_EXE)
+       $(EXEPREP)
+
+############################################################################
 # build volinfo
 VOLINFO = $(DESTDIR)\root.server\usr\afs\bin\volinfo.exe
 
index 4af0daa..146431f 100644 (file)
@@ -124,6 +124,7 @@ RCSID
 #include "vol-salvage.h"
 #ifdef AFS_NT40_ENV
 #include <pthread.h>
+pthread_t main_thread;
 #endif
 
 
@@ -350,12 +351,6 @@ handleit(struct cmd_syndesc *as)
 #ifndef AFS_NT40_ENV
 #include "AFS_component_version_number.c"
 #endif
-#define MAX_ARGS 128
-#ifdef AFS_NT40_ENV
-char *save_args[MAX_ARGS];
-int n_save_args = 0;
-pthread_t main_thread;
-#endif
 
 int
 main(int argc, char **argv)
index 141cc4c..76a5838 100644 (file)
@@ -317,15 +317,14 @@ BadError(register int aerror)
     return 0;                  /* otherwise may be transient, e.g. EMFILE */
 }
 
-
 #define MAX_ARGS 128
 #ifdef AFS_NT40_ENV
 char *save_args[MAX_ARGS];
 int n_save_args = 0;
-pthread_t main_thread;
+extern pthread_t main_thread;
+childJob_t myjob = { SALVAGER_MAGIC, NOT_CHILD, "" };
 #endif
 
-
 /* Get the salvage lock if not already held. Hold until process exits. */
 void
 ObtainSalvageLock(void)
index c95ce24..7c89220 100644 (file)
@@ -202,7 +202,7 @@ typedef struct {
 } childJob_t;
 
 /* Child job this process is running. */
-extern childJob_t myjob = { SALVAGER_MAGIC, NOT_CHILD, "" };
+extern childJob_t myjob;
 
 extern int nt_SalvagePartition(char *partName, int jobn);
 extern int nt_SetupPartitionSalvage(void *datap, int len);