aboutsummaryrefslogtreecommitdiffstats
path: root/pseudo_wrappers.c
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2010-08-03 21:04:37 -0500
committerseebs <seebs@seebs-eee.(none)>2010-08-04 17:13:39 -0500
commit551bf567c171c9f6f475f02de80e35df9563dce7 (patch)
tree42fb4fa11dd734c8880ea6f5d1093f282c65d48a /pseudo_wrappers.c
parent8bf7df7ee9360d5d1256498bd5e97d3c6bc387f6 (diff)
downloadpseudo-551bf567c171c9f6f475f02de80e35df9563dce7.tar.gz
pseudo-551bf567c171c9f6f475f02de80e35df9563dce7.tar.bz2
pseudo-551bf567c171c9f6f475f02de80e35df9563dce7.zip
Add new environment values to allow easy override of default locations
Add PSEUDO_BINDIR, PSEUDO_LIBDIR, and PSEUDO_LOCALSTATEDIR to allow for more easy customization of PSEUDO components at run-time. If these are not set they will be automatically generated based on the existing PSEUDO_PREFIX path. PSEUDO_BINDIR = PSEUDO_PREFIX /bin PSEUDO_LIBDIR = PSEUDO_PREFIX /lib PSEUDO_LOCALSTATEDIR = PSEUDO_PREFIX /var/pseudo Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'pseudo_wrappers.c')
-rw-r--r--pseudo_wrappers.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/pseudo_wrappers.c b/pseudo_wrappers.c
index fd51e9a..4e98efa 100644
--- a/pseudo_wrappers.c
+++ b/pseudo_wrappers.c
@@ -181,16 +181,32 @@ pseudo_populate_wrappers(void) {
*/
pseudo_client_reset();
pseudo_path = pseudo_prefix_path(NULL);
- if (pseudo_dir_fd == -1) {
+ if (pseudo_prefix_dir_fd == -1) {
if (pseudo_path) {
- pseudo_dir_fd = open(pseudo_path, O_RDONLY);
- pseudo_dir_fd = pseudo_fd(pseudo_dir_fd, MOVE_FD);
+ pseudo_prefix_dir_fd = open(pseudo_path, O_RDONLY);
+ pseudo_prefix_dir_fd = pseudo_fd(pseudo_prefix_dir_fd, MOVE_FD);
free(pseudo_path);
} else {
pseudo_diag("No prefix available to to find server.\n");
exit(1);
}
- if (pseudo_dir_fd == -1) {
+ if (pseudo_prefix_dir_fd == -1) {
+ pseudo_diag("Can't open prefix path (%s) for server.\n",
+ strerror(errno));
+ exit(1);
+ }
+ }
+ pseudo_path = pseudo_localstatedir_path(NULL);
+ if (pseudo_localstate_dir_fd == -1) {
+ if (pseudo_path) {
+ pseudo_localstate_dir_fd = open(pseudo_path, O_RDONLY);
+ pseudo_localstate_dir_fd = pseudo_fd(pseudo_localstate_dir_fd, MOVE_FD);
+ free(pseudo_path);
+ } else {
+ pseudo_diag("No prefix available to to find server.\n");
+ exit(1);
+ }
+ if (pseudo_localstate_dir_fd == -1) {
pseudo_diag("Can't open prefix path (%s) for server.\n",
strerror(errno));
exit(1);