From: Stephen Hemminger Date: Fri, 15 Mar 2019 15:30:26 +0000 (-0700) Subject: ipaddress: print error message on stderr X-Git-Tag: v5.0.0~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f36f8fe535c97f521cc76c2ceae06c2b6443ad98;p=thirdparty%2Fiproute2.git ipaddress: print error message on stderr Convention is to print error messages only on stderr. Helps when scripting. Signed-off-by: Stephen Hemminger --- diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 76edf7064..b504200bb 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -174,7 +174,9 @@ static void print_queuelen(FILE *f, struct rtattr *tb[IFLA_MAX + 1]) strcpy(ifr.ifr_name, rta_getattr_str(tb[IFLA_IFNAME])); if (ioctl(s, SIOCGIFTXQLEN, &ifr) < 0) { - fprintf(f, "ioctl(SIOCGIFTXQLEN) failed: %s\n", strerror(errno)); + fprintf(stderr, + "ioctl(SIOCGIFTXQLEN) failed: %s\n", + strerror(errno)); close(s); return; }