From c4a89f3f79d6b5c62ccd91f3e7e01d38e3e80c1f Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Tue, 30 Jan 2007 12:14:49 +0000 Subject: [PATCH] windows-vol-fix-salvager-20070130 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 | 16 +++++++++++++++- src/vol/salvager.c | 7 +------ src/vol/vol-salvage.c | 5 ++--- src/vol/vol-salvage.h | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/src/vol/NTMakefile b/src/vol/NTMakefile index 6396eaedc..240ea42ed 100644 --- a/src/vol/NTMakefile +++ b/src/vol/NTMakefile @@ -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 \ @@ -88,6 +88,20 @@ $(SALVAGER): $(SALVAGER_EXEOBJS) $(EXEC_LIBS) $(EXEPREP) +############################################################################ +# 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 diff --git a/src/vol/salvager.c b/src/vol/salvager.c index 4af0daa21..146431f34 100644 --- a/src/vol/salvager.c +++ b/src/vol/salvager.c @@ -124,6 +124,7 @@ RCSID #include "vol-salvage.h" #ifdef AFS_NT40_ENV #include +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) diff --git a/src/vol/vol-salvage.c b/src/vol/vol-salvage.c index 141cc4cb4..76a58387c 100644 --- a/src/vol/vol-salvage.c +++ b/src/vol/vol-salvage.c @@ -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) diff --git a/src/vol/vol-salvage.h b/src/vol/vol-salvage.h index c95ce249d..7c892204e 100644 --- a/src/vol/vol-salvage.h +++ b/src/vol/vol-salvage.h @@ -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); -- 2.39.5