X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/58bca61d95cf59937d54f0a2863a67e3ad6db420..430f81c3e8403e1b366018124c1bece2685f94b1:/usr/src/sys/netns/ns_error.c diff --git a/usr/src/sys/netns/ns_error.c b/usr/src/sys/netns/ns_error.c index e5b1c3ede4..4e5cbfd4db 100644 --- a/usr/src/sys/netns/ns_error.c +++ b/usr/src/sys/netns/ns_error.c @@ -1,9 +1,15 @@ /* - * Copyright (c) 1984, 1985 Regents of the University of California. - * All rights reserved. The Berkeley software License Agreement - * specifies the terms and conditions for redistribution. + * Copyright (c) 1984, 1988 Regents of the University of California. + * All rights reserved. * - * @(#)ns_error.c 6.8 (Berkeley) %G% + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of California at Berkeley. The name of the University + * may not be used to endorse or promote products derived from this + * software without specific prior written permission. This software + * is provided ``as is'' without express or implied warranty. + * + * @(#)ns_error.c 7.5 (Berkeley) %G% */ #include "param.h" @@ -33,6 +39,26 @@ int ns_errprintfs = 0; #endif +ns_err_x(c) +{ + register u_short *w, *lim, *base = ns_errstat.ns_es_codes; + u_short x = c; + + /* + * zero is a legit error code, handle specially + */ + if (x == 0) + return (0); + lim = base + NS_ERR_MAX - 1; + for (w = base + 1; w < lim; w++) { + if (*w == 0) + *w = x; + if (*w == x) + break; + } + return (w - base); +} + /* * Generate an error packet of type error * in response to bad packet. @@ -237,7 +263,7 @@ free: u_long nstime() { - int s = spl6(); + int s = splclock(); u_long t; t = (time.tv_sec % (24*60*60)) * 1000 + time.tv_usec / 1000;