[Sheepdog] [PATCH RESEND] sheep: use sys_stat_* helper to check status

Liu Yuan namei.unix at gmail.com
Thu Nov 17 11:03:21 CET 2011


From: Liu Yuan <tailai.ly at taobao.com>


Signed-off-by: Liu Yuan <tailai.ly at taobao.com>
---
 sheep/sdnet.c |    2 +-
 sheep/sheep.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sheep/sdnet.c b/sheep/sdnet.c
index a8ea295..053ee8d 100644
--- a/sheep/sdnet.c
+++ b/sheep/sdnet.c
@@ -549,7 +549,7 @@ static void listen_handler(int listen_fd, int events, void *data)
 	int fd, ret;
 	struct client_info *ci;
 
-	if (sys->status == SD_STATUS_SHUTDOWN) {
+	if (sys_stat_shutdown()) {
 		dprintf("unregistering connection %d\n", listen_fd);
 		unregister_event(listen_fd);
 		return;
diff --git a/sheep/sheep.c b/sheep/sheep.c
index cc6921e..94b4a9e 100644
--- a/sheep/sheep.c
+++ b/sheep/sheep.c
@@ -209,7 +209,7 @@ int main(int argc, char **argv)
 
 	vprintf(SDOG_NOTICE, "sheepdog daemon (version %s) started\n", PACKAGE_VERSION);
 
-	while (sys->status != SD_STATUS_SHUTDOWN || sys->nr_outstanding_reqs != 0)
+	while (!sys_stat_shutdown() || sys->nr_outstanding_reqs != 0)
 		event_loop(-1);
 
 	vprintf(SDOG_INFO, "shutdown\n");
-- 
1.7.6.1




More information about the sheepdog mailing list