volser: Don't declare cstruct twice
authorSimon Wilkinson <sxw@your-file-system.com>
Tue, 5 Jul 2011 08:27:05 +0000 (09:27 +0100)
committerJeffrey Altman <jaltman@openafs.org>
Wed, 7 Sep 2011 00:42:25 +0000 (17:42 -0700)
Both vsprocs.c and vsutils.c declare the global variable 'cstruct'
(which is initialised by vos.c in order to pass a ubik client structure
through to many of the libvolser functions). This double declaration
prevents libvolser from being linked as a shared library on some
platforms. We only need one of these, so just make vsprocs.c declare it,
and vsutils.c refer to it as an extern.

Of course, using a global variable to pass state around is really quite
nasty, but let's fix that in another change.

Change-Id: Ief1667bd7a5b70dbfb49cdc02cc435eb2344527e
Reviewed-on: http://gerrit.openafs.org/5362
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementix.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/volser/vsprocs.c

index ef6ef75..3c126ee 100644 (file)
@@ -53,7 +53,7 @@
 #include "vsutils_prototypes.h"
 #include "lockprocs_prototypes.h"
 
-struct ubik_client *cstruct;
+extern struct ubik_client *cstruct;
 int verbose = 0, noresolve = 0;
 
 struct release {