From 13703fb15fb6a225ccf2488e3680ac14331c1c9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Fri, 21 Feb 2020 16:40:22 +0000 Subject: [PATCH] Allow to setup beat without [back]up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud | 2 +- src/path.c | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mud b/mud index 5be4096..4a7740f 160000 --- a/mud +++ b/mud @@ -1 +1 @@ -Subproject commit 5be4096452ea258c36679e8571fb9708f0ff1df2 +Subproject commit 4a7740f70f7ee585e02b46af053deba1b9bcb488 diff --git a/src/path.c b/src/path.c index 5288b19..aff7d29 100644 --- a/src/path.c +++ b/src/path.c @@ -189,9 +189,10 @@ gt_path(int argc, char **argv) return 1; } - int set_rate = argz_is_set(pathz, "rate"); + int set = argz_is_set(pathz, "rate") + || argz_is_set(pathz, "beat"); - if (set_rate && !req.path.addr.ss_family) { + if (set && !req.path.addr.ss_family) { gt_log("please specify a path\n"); return 1; } @@ -213,7 +214,7 @@ gt_path(int argc, char **argv) int ret; if (!req.path.addr.ss_family || - (req.path.state == MUD_EMPTY && !set_rate)) { + (req.path.state == MUD_EMPTY && !set)) { ret = gt_path_status(fd, req.path.state, &req.path.addr); } else { ret = ctl_reply(fd, &res, &req);