aboutsummaryrefslogtreecommitdiff
path: root/rcynic
diff options
context:
space:
mode:
Diffstat (limited to 'rcynic')
-rw-r--r--rcynic/Makefile.in21
-rw-r--r--rcynic/rcynic.c6
2 files changed, 13 insertions, 14 deletions
diff --git a/rcynic/Makefile.in b/rcynic/Makefile.in
index 1d146b7c..b003437e 100644
--- a/rcynic/Makefile.in
+++ b/rcynic/Makefile.in
@@ -1,25 +1,22 @@
# $Id$
-OPENSSL_DIR = ../openssl/openssl
+NAME = rcynic
-# Disable -Werror as long as we're using OpenSSL snapshots.
+BIN = ${NAME}
+SRC = ${NAME}.c
+OBJ = ${NAME}.o
-CFLAGS = -g -I${OPENSSL_DIR}/include -Wall -Wshadow -Wmissing-prototypes -Wmissing-declarations
-LDFLAGS = @LD_STATIC_FLAG@
-
-# -H -Wl,-t
-
-BIN = rcynic
-OBJ = rcynic.o
-LIB = ${OPENSSL_DIR}/libcrypto.a
+CFLAGS = @CFLAGS@ -Wall -Wshadow -Wmissing-prototypes -Wmissing-declarations
+LDFLAGS = @LDFLAGS@ @LD_STATIC_FLAG@
+LIBS = @LIBS@
all: ${BIN}
clean:
rm -f ${BIN} ${OBJ}
-${BIN}: ${OBJ} ${LIB} Makefile
- ${CC} -g -o $@ ${OBJ} ${LIB} ${LDFLAGS}
+${BIN}: ${SRC}
+ ${CC} ${CFLAGS} -o $@ ${SRC} ${LDFLAGS} -lcrypto ${LIBS}
test: ${BIN}
if test -r rcynic.conf; then ./${BIN} -j 0 && echo && ./show.sh; else echo No rcynic.conf, skipping test; fi
diff --git a/rcynic/rcynic.c b/rcynic/rcynic.c
index 988736ac..b78e2410 100644
--- a/rcynic/rcynic.c
+++ b/rcynic/rcynic.c
@@ -1363,8 +1363,10 @@ static int rsync(const rcynic_ctx_t *rc,
close(pipe_fds[1]);
- deadline = time(0) + rc->rsync_timeout;
+ now = time(0);
+ deadline = now + rc->rsync_timeout;
+ n = -1;
i = 0;
while ((wpid = waitpid(pid, &pid_status, WNOHANG)) == 0 &&
(!rc->rsync_timeout || (now = time(0)) < deadline)) {
@@ -3226,7 +3228,7 @@ int main(int argc, char *argv[])
time_t tad_time = time(0);
struct tm *tad_tm = gmtime(&tad_time);
int ok = 1, use_stdout = !strcmp(xmlfile, "-");
- FILE *f;
+ FILE *f = NULL;
strftime(tad, sizeof(tad), "%Y-%m-%dT%H:%M:%SZ", tad_tm);