From f36f8fe535c97f521cc76c2ceae06c2b6443ad98 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 15 Mar 2019 08:30:26 -0700 Subject: [PATCH] ipaddress: print error message on stderr Convention is to print error messages only on stderr. Helps when scripting. Signed-off-by: Stephen Hemminger --- ip/ipaddress.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.47.2