summaryrefslogtreecommitdiffstats
path: root/src/rccexternal.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2010-03-11 18:52:52 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2010-03-11 18:52:52 +0100
commit6d7c759b430bebb5a2a3ef6954bbb889ff55c378 (patch)
tree6ed30e8423e7cc136679a0c0492e5474f083f1ea /src/rccexternal.c
parentee5803048cecea310be065e068cee40d08135ef9 (diff)
downloadlibrcc-6d7c759b430bebb5a2a3ef6954bbb889ff55c378.tar.gz
librcc-6d7c759b430bebb5a2a3ef6954bbb889ff55c378.tar.bz2
librcc-6d7c759b430bebb5a2a3ef6954bbb889ff55c378.tar.xz
librcc-6d7c759b430bebb5a2a3ef6954bbb889ff55c378.zip
Few bugs found by lint of OpenSuSE, many thanks to Novel
Diffstat (limited to 'src/rccexternal.c')
-rw-r--r--src/rccexternal.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/rccexternal.c b/src/rccexternal.c
index 080e4da..f1e8fba 100644
--- a/src/rccexternal.c
+++ b/src/rccexternal.c
@@ -70,6 +70,7 @@ static char *addr = NULL;
int rccExternalInit() {
#ifdef HAVE_SIGNAL_H
struct sigaction act;
+ struct stat st;
#endif /* HAVE_SIGNAL_H */
if (pid != (pid_t)-1) return 0;
@@ -93,8 +94,12 @@ int rccExternalInit() {
return 0;
}
-
- execl(LIBRCC_DATA_DIR "/" RCC_EXT_PROG_NAME, RCC_EXT_PROG_NAME, NULL);
+
+ /*if ((!stat("../external/" RCC_EXT_PROG_NAME, &st))&&(st.st_mode&S_IXOTH)) {
+ execl ("../external/" RCC_EXT_PROG_NAME, RCC_EXT_PROG_NAME, NULL);
+ } else*/ if ((!stat(LIBRCC_DATA_DIR "/" RCC_EXT_PROG_NAME, &st))&&(st.st_mode&S_IXOTH)) {
+ execl(LIBRCC_DATA_DIR "/" RCC_EXT_PROG_NAME, RCC_EXT_PROG_NAME, NULL);
+ }
exit(1);
}