diff options
author | Eitan Adler <eadler@FreeBSD.org> | 2013-12-04 20:07:34 +0000 |
---|---|---|
committer | Eitan Adler <eadler@FreeBSD.org> | 2013-12-04 20:07:34 +0000 |
commit | 2fc0b5854418119e59ea9f62de2992957e86a7a4 (patch) | |
tree | 2bca3918395c9997ce2dcff54b7b2b58da601eef /sbin/route | |
parent | b9f2ea4a57757882403b24c4e8041838cc0fd8f7 (diff) | |
download | src-2fc0b5854418119e59ea9f62de2992957e86a7a4.tar.gz src-2fc0b5854418119e59ea9f62de2992957e86a7a4.zip |
route(1): Pull static variable out of the function and into function scope.
This will make it easier to link as a library.
Submitted by: Sebastian Huber <sebastian.huber@embedded-brains.de> (older version)
Discussed on: -hackers
Notes
Notes:
svn path=/head/; revision=258937
Diffstat (limited to 'sbin/route')
-rw-r--r-- | sbin/route/route.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sbin/route/route.c b/sbin/route/route.c index a5e841970fd2..131fa8d1ceff 100644 --- a/sbin/route/route.c +++ b/sbin/route/route.c @@ -95,6 +95,7 @@ static int defaultfib; static int numfibs; static char domain[MAXHOSTNAMELEN + 1]; static bool domain_initialized; +static int rtm_seq; static int atalk_aton(const char *, struct at_addr *); static char *atalk_ntoa(struct at_addr, char [ATALK_BUF_SIZE]); @@ -1490,7 +1491,6 @@ static struct { static int rtmsg(int cmd, int flags, int fib) { - static int seq; int rlen; char *cp = m_rtmsg.m_space; int l; @@ -1526,7 +1526,7 @@ rtmsg(int cmd, int flags, int fib) rtm.rtm_type = cmd; rtm.rtm_flags = flags; rtm.rtm_version = RTM_VERSION; - rtm.rtm_seq = ++seq; + rtm.rtm_seq = ++rtm_seq; rtm.rtm_addrs = rtm_addrs; rtm.rtm_rmx = rt_metrics; rtm.rtm_inits = rtm_inits; @@ -1551,7 +1551,7 @@ rtmsg(int cmd, int flags, int fib) if (cmd == RTM_GET) { do { l = read(s, (char *)&m_rtmsg, sizeof(m_rtmsg)); - } while (l > 0 && (rtm.rtm_seq != seq || rtm.rtm_pid != pid)); + } while (l > 0 && (rtm.rtm_seq != rtm_seq || rtm.rtm_pid != pid)); if (l < 0) warn("read from routing socket"); else |