From: Sebastian Harl Date: Sun, 5 Jun 2016 12:27:11 +0000 (+0200) Subject: Merge pull request #1746 from rubenk/swrite-check-for-open-fd X-Git-Tag: collectd-5.6.0~229 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3f8fcdf9a0184e2e2cb3098a94f0223cf54373d4;hp=d54f3b1640ee23b5213ac870ca3de558f54e8247;p=collectd.git Merge pull request #1746 from rubenk/swrite-check-for-open-fd swrite: return error if fd is negative --- diff --git a/src/apcups.c b/src/apcups.c index 2d1c16bb..9f7476bf 100644 --- a/src/apcups.c +++ b/src/apcups.c @@ -89,7 +89,7 @@ static int net_shutdown (int *fd) if ((fd == NULL) || (*fd < 0)) return (EINVAL); - swrite (*fd, (void *) &packet_size, sizeof (packet_size)); + (void)swrite (*fd, (void *) &packet_size, sizeof (packet_size)); close (*fd); *fd = -1;