diff options
author | Gary Mills <gary_mills@fastmail.fm> | 2014-06-13 09:17:14 -0500 |
---|---|---|
committer | Dan McDonald <danmcd@omniti.com> | 2014-06-17 15:30:28 -0400 |
commit | 09b0d01c5bc323b8ee7043100e09aded27cc12ab (patch) | |
tree | bca93c0aacc9e0233bbf8e8fcb30c92bd8dff82b /usr/src/lib/libnsl | |
parent | 33392354a001a7e6e504717bd3f249456d36cc00 (diff) | |
download | illumos-gate-09b0d01c5bc323b8ee7043100e09aded27cc12ab.tar.gz |
3910 t_look(3NSL) should never return T_ERROR
Reviewed by: Marcel Telka <marcel@telka.sk>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Approved by: Dan McDonald <danmcd@omniti.com>
Diffstat (limited to 'usr/src/lib/libnsl')
-rw-r--r-- | usr/src/lib/libnsl/dial/interface.c | 14 | ||||
-rw-r--r-- | usr/src/lib/libnsl/nsl/t_look.c | 24 | ||||
-rw-r--r-- | usr/src/lib/libnsl/nsl/tx.h | 9 | ||||
-rw-r--r-- | usr/src/lib/libnsl/rpc/svc_dg.c | 5 |
4 files changed, 15 insertions, 37 deletions
diff --git a/usr/src/lib/libnsl/dial/interface.c b/usr/src/lib/libnsl/dial/interface.c index 0381b9f5ee..09f0a8d55a 100644 --- a/usr/src/lib/libnsl/dial/interface.c +++ b/usr/src/lib/libnsl/dial/interface.c @@ -26,10 +26,9 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2014 Gary Mills */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * interface( label ) * provide alternate definitions for the I/O functions through global @@ -287,10 +286,10 @@ tfaillog(int fd, const char *s) } } else { (void) snprintf(fmt, sizeof (fmt), - "unknown tli error %d", t_errno); + "unknown tli error %d", t_errno); logent(s, fmt); (void) snprintf(fmt, sizeof (fmt), - "%s: unknown tli error %d", s, t_errno); + "%s: unknown tli error %d", s, t_errno); DEBUG(5, fmt, 0); (void) snprintf(fmt, sizeof (fmt), "%s: %%s\n", s); DEBUG(5, fmt, strerror(errno)); @@ -329,7 +328,6 @@ show_tlook(int fd) case T_EXDATA: msg = (const char *)"T_EXDATA"; break; case T_DISCONNECT: msg = (const char *)"T_DISCONNECT"; break; case T_ORDREL: msg = (const char *)"T_ORDREL"; break; - case T_ERROR: msg = (const char *)"T_ERROR"; break; case T_UDERR: msg = (const char *)"T_UDERR"; break; default: msg = (const char *)"UNKNOWN ERROR"; break; } @@ -338,9 +336,9 @@ show_tlook(int fd) if (reason == T_DISCONNECT) { struct t_discon *dropped; if (((dropped = - /* LINTED pointer cast */ - (struct t_discon *)t_alloc(fd, T_DIS, T_ALL)) == 0) || - (t_rcvdis(fd, dropped) == -1)) { + /* LINTED pointer cast */ + (struct t_discon *)t_alloc(fd, T_DIS, T_ALL)) == 0) || + (t_rcvdis(fd, dropped) == -1)) { if (dropped) (void) t_free((char *)dropped, T_DIS); return; diff --git a/usr/src/lib/libnsl/nsl/t_look.c b/usr/src/lib/libnsl/nsl/t_look.c index 91ff5271cf..2a91d3da6b 100644 --- a/usr/src/lib/libnsl/nsl/t_look.c +++ b/usr/src/lib/libnsl/nsl/t_look.c @@ -26,10 +26,9 @@ /* * Copyright 2006 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2014 Gary Mills */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include "mt.h" #include <errno.h> #include <unistd.h> @@ -133,23 +132,9 @@ _t_look_locked( } while (retval < 0 && errno == EINTR); if (retval < 0) { - if (_T_IS_TLI(api_semantics)) { - /* - * This return of T_ERROR event is ancient - * SVR3 TLI semantics and not documented for - * current SVR4 TLI interface. - * Fixing this will impact some apps - * (e.g. nfsd,lockd) in ON consolidation - * so they need to be fixed first before TLI - * can be fixed. - * XXX Should we never fix this because it might - * break apps in field ? - */ - return (T_ERROR); - } /* - * XTI semantics (also identical to documented, - * but not implemented TLI semantics). + * XTI semantics (also identical to documented + * TLI semantics). */ t_errno = TSYSERR; return (-1); @@ -159,7 +144,8 @@ _t_look_locked( * if something there and cntl part also there */ if ((tiptr->ti_lookcnt > 0) || - ((retval > 0) && (strpeek.ctlbuf.len >= (int)sizeof (t_scalar_t)))) { + ((retval > 0) && (strpeek.ctlbuf.len >= + (int)sizeof (t_scalar_t)))) { /* LINTED pointer cast */ pptr = (union T_primitives *)strpeek.ctlbuf.buf; if (tiptr->ti_lookcnt > 0) { diff --git a/usr/src/lib/libnsl/nsl/tx.h b/usr/src/lib/libnsl/nsl/tx.h index bc0665711b..265e0d33b3 100644 --- a/usr/src/lib/libnsl/nsl/tx.h +++ b/usr/src/lib/libnsl/nsl/tx.h @@ -21,6 +21,7 @@ */ /* + * Copyright 2014 Gary Mills * Copyright 2005 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -28,8 +29,6 @@ #ifndef _TX_H #define _TX_H -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/uio.h> #ifdef __cplusplus @@ -251,12 +250,6 @@ extern char tiusr_statetbl[T_NOEVENTS][T_NOSTATES]; #define REMOTENAME 1 /* - * Obsolete error event for t_look() in TLI, still needed for compatibility - * to broken apps that are affected (e.g nfsd,lockd) if real error returned. - */ -#define T_ERROR 0x0020 - -/* * GENERAL UTILITY MACROS */ #define A_CNT(arr) (sizeof (arr)/sizeof (arr[0])) diff --git a/usr/src/lib/libnsl/rpc/svc_dg.c b/usr/src/lib/libnsl/rpc/svc_dg.c index 030a1e52b1..0ecd3819fa 100644 --- a/usr/src/lib/libnsl/rpc/svc_dg.c +++ b/usr/src/lib/libnsl/rpc/svc_dg.c @@ -20,6 +20,7 @@ */ /* + * Copyright 2014 Gary Mills * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -384,7 +385,7 @@ again: int lookres; lookres = t_look(xprt->xp_fd); - if ((lookres & T_UDERR) && + if ((lookres == T_UDERR) && (t_rcvuderr(xprt->xp_fd, (struct t_uderr *)0) < 0)) { /*EMPTY*/ @@ -394,7 +395,7 @@ again: t_errno); #endif } - if (lookres & T_DATA) + if (lookres == T_DATA) goto again; } else if ((errno == EINTR) && (t_errno == TSYSERR)) goto again; |