From 705b5a18d7b5fc60533df54ecc7157be2565227c Mon Sep 17 00:00:00 2001 From: Lon Hohberger Date: Thu, 17 Sep 2009 14:11:08 -0400 Subject: [PATCH] Fix build errors on Fedora Signed-off-by: Lon Hohberger --- client/mcast.c | 6 ++++-- config/config.l | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/mcast.c b/client/mcast.c index cf5f37b..e9c9ab7 100644 --- a/client/mcast.c +++ b/client/mcast.c @@ -90,9 +90,9 @@ static int tcp_exchange(int fd, fence_auth_type_t auth, void *key, size_t key_len, int timeout) { - char ret; fd_set rfds; struct timeval tv; + char ret = 1; /* Ok, we're connected */ dbg_printf(3, "Issuing TCP challenge\n"); @@ -122,8 +122,10 @@ tcp_exchange(int fd, fence_auth_type_t auth, void *key, return -1; /* Read return code */ - read(fd, &ret, 1); + if (read(fd, &ret, 1) < 0) + ret = 1; close(fd); + if (ret == 0) printf("Remote: Operation was successful\n"); else diff --git a/config/config.l b/config/config.l index dac305d..c436aeb 100644 --- a/config/config.l +++ b/config/config.l @@ -7,6 +7,9 @@ #include "y.tab.h" #include "simpleconfig.h" +/* Some distributions can't use the output from flex without help */ +#define ECHO if(fwrite( yytext, yyleng, 1, yyout )) + struct value *val_list = NULL; struct node *node_list = NULL; struct parser_context *context_stack = NULL;