Hi,

when a default gateway is not set :

# route get 4.4.4.4
route: writing to routing socket: No such process

this small patch uses oerrno translation :

# route get 4.4.4.4
get host 4.4.4.4: not in table

Index: route.c
===================================================================
RCS file: /cvs/src/sbin/route/route.c,v
retrieving revision 1.203
diff -u -p -r1.203 route.c
--- route.c     6 Sep 2017 20:21:22 -0000       1.203
+++ route.c     11 Oct 2017 22:05:22 -0000
@@ -676,8 +676,7 @@ newroute(int argc, char **argv)
        }
        if (*cmd == 'g') {
                if (ret != 0 && qflag == 0)
-                       warn("writing to routing socket");
-               exit(0);
+                       oerrno = ESRCH;
        }
        oerrno = errno;
        if (!qflag) {

Reply via email to