X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Futils_cmd_listval.c;fp=src%2Futils_cmd_listval.c;h=13906c18430b492f5923a76d8fe2a089c844006b;hb=5416295cbf519eee82bfc96e4ffd503562ea1189;hp=864e5f440a002c5dc516c1932c3f555ebd819368;hpb=993900f43c19c3836a6a4e89268ffb6d17d0fce0;p=collectd.git diff --git a/src/utils_cmd_listval.c b/src/utils_cmd_listval.c index 864e5f44..13906c18 100644 --- a/src/utils_cmd_listval.c +++ b/src/utils_cmd_listval.c @@ -39,13 +39,15 @@ } while (0) #define print_to_socket(fh, ...) \ - if (fprintf (fh, __VA_ARGS__) < 0) { \ - char errbuf[1024]; \ - WARNING ("handle_listval: failed to write to socket #%i: %s", \ - fileno (fh), sstrerror (errno, errbuf, sizeof (errbuf))); \ - free_everything_and_return (-1); \ - } \ - fflush(fh); + do { \ + if (fprintf (fh, __VA_ARGS__) < 0) { \ + char errbuf[1024]; \ + WARNING ("handle_listval: failed to write to socket #%i: %s", \ + fileno (fh), sstrerror (errno, errbuf, sizeof (errbuf))); \ + free_everything_and_return (-1); \ + } \ + fflush(fh); \ + } while (0); int handle_listval (FILE *fh, char *buffer) {