From: Alan T. DeKok Date: Thu, 21 Feb 2013 00:48:00 +0000 (-0500) Subject: dup may return < 0 X-Git-Tag: release_3_0_0_beta1~963 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bb1d8a2a3c1cd9cf116f8aeba3b4892502cff7d;p=thirdparty%2Ffreeradius-server.git dup may return < 0 --- diff --git a/src/main/command.c b/src/main/command.c index 252691ab510..ad76d797fe9 100644 --- a/src/main/command.c +++ b/src/main/command.c @@ -719,7 +719,8 @@ static int command_show_xml(rad_listen_t *listener, UNUSED int argc, UNUSED char FILE *fp; fd = dup(listener->fd); - if (!fd) return 0; + if (fd < 0) return 0; + fp = fdopen(fd, "a"); if (!fp) { cprintf(listener, "ERROR: Can't dup %s\n", strerror(errno));