X-Git-Url: https://www.tinc-vpn.org/git/browse?a=blobdiff_plain;f=src%2Ftincctl.c;h=eaf14e03fbed97202af79477b7e28889d4fba674;hb=d21f63d5b39280b653ca72a272f3a70c7c3f03be;hp=7b44881f3cf842c1a8295e6f2430c59741c2820d;hpb=26eca516508829c3f9d8f2549335f613b569e8f5;p=tinc diff --git a/src/tincctl.c b/src/tincctl.c index 7b44881f..eaf14e03 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -834,16 +834,10 @@ static int cmd_stop(int argc, char *argv[]) { } sendline(fd, "%d %d", CONTROL, REQ_STOP); - if(!recvline(fd, line, sizeof line) || sscanf(line, "%d %d %d", &code, &req, &result) != 3 || code != CONTROL || req != REQ_STOP || result) { - fprintf(stderr, "Could not stop tinc daemon.\n"); - return 1; - } - // Wait for tincd to close the connection... - fd_set r; - FD_ZERO(&r); - FD_SET(fd, &r); - select(fd + 1, &r, NULL, NULL, NULL); + while(recvline(fd, line, sizeof line)) { + // Wait for tincd to close the connection... + } #else if(!remove_service()) return 1;