Skip to content

Commit

Permalink
setrepos: let environment override LW_WFDB.
Browse files Browse the repository at this point in the history
In general, the WFDB variable won't be set in the web server's
environment.  By allowing the environment variable to override
LW_WFDB, we can have a single (sandboxed-)lightwave binary whose
default path is different from the WFDB library's default path, but
the path can also be overridden if necessary.
  • Loading branch information
Benjamin Moody committed Apr 23, 2019
1 parent 1acd40c commit b92edac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/setrepos.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* file: setrepos.c G. Moody 17 February 2013
Last revised: 23 April 2019
This file defines the LightWAVE server's setrepos() macro, which is used to
define the set of data repositories accessible via the server. LW_WFDB can be
Expand All @@ -19,7 +20,10 @@ compiled).
*/

#ifdef LW_WFDB
#define setrepos() setwfdb(LW_WFDB)
#define setrepos() do { \
if (!getenv("WFDB")) \
setwfdb(LW_WFDB); \
} while (0)
#else
#define setrepos()
#endif

0 comments on commit b92edac

Please sign in to comment.