-/* $OpenBSD: route.c,v 1.183 2016/06/07 01:29:38 tedu Exp $ */
+/* $OpenBSD: route.c,v 1.184 2016/07/09 20:39:17 tedu Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
} else
break;
}
- if (*cmd == 'g')
+ if (*cmd == 'g') {
+ if (ret != 0 && qflag == 0)
+ warn("writing to routing socket");
exit(0);
+ }
oerrno = errno;
if (!qflag) {
printf("%s %s %s", cmd, ishost ? "host" : "net", dest);
if (debugonly)
return (0);
if (write(s, &m_rtmsg, l) != l) {
- if (qflag == 0)
- warn("writing to routing socket");
return (-1);
}
if (cmd == RTM_GET) {