]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ipaddress: print error message on stderr
authorStephen Hemminger <stephen@networkplumber.org>
Fri, 15 Mar 2019 15:30:26 +0000 (08:30 -0700)
committerStephen Hemminger <stephen@networkplumber.org>
Fri, 15 Mar 2019 15:30:26 +0000 (08:30 -0700)
Convention is to print error messages only on stderr.
Helps when scripting.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ipaddress.c

index 76edf7064819c08970db32e5ddf665112996be9a..b504200bb3776a09d90a6ff697da4846bcb890d4 100644 (file)
@@ -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;
                }