summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ctdb/Makefile.in2
-rw-r--r--ctdb/utils/smnotify/smnotify.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/ctdb/Makefile.in b/ctdb/Makefile.in
index bc604c448d3..f1b08f14e99 100644
--- a/ctdb/Makefile.in
+++ b/ctdb/Makefile.in
@@ -85,7 +85,7 @@ bin/ctdb: $(CTDB_CLIENT_OBJ) tools/ctdb.o
@echo Linking $@
@$(CC) $(CFLAGS) -o $@ tools/ctdb.o $(CTDB_CLIENT_OBJ) $(LIB_FLAGS)
-bin/smnotify: utils/smnotify/smnotify.o utils/smnotify/gen_xdr.o utils/smnotify/gen_smnotify.o
+bin/smnotify: utils/smnotify/gen_xdr.o utils/smnotify/gen_smnotify.o utils/smnotify/smnotify.o
@echo Linking $@
@$(CC) $(CFLAGS) -o $@ utils/smnotify/smnotify.o utils/smnotify/gen_xdr.o utils/smnotify/gen_smnotify.o $(LIB_FLAGS)
diff --git a/ctdb/utils/smnotify/smnotify.c b/ctdb/utils/smnotify/smnotify.c
index 89e7582da2e..b93ce38776d 100644
--- a/ctdb/utils/smnotify/smnotify.c
+++ b/ctdb/utils/smnotify/smnotify.c
@@ -17,6 +17,7 @@
along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
+#include <unistd.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
@@ -118,6 +119,9 @@ int main(int argc, const char *argv[])
*/
s = create_socket(ip, sendport);
+ /* only wait for at most 3 seconds before giving up */
+ alarm(3);
+
/* Setup a sockaddr_in for the client we want to notify */
bzero(&sock_cl, sizeof(sock_cl));
sock_cl.sin_family = PF_INET;