Print this page
3910 t_look(3NSL) should never return T_ERROR

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libnsl/dial/interface.c
          +++ new/usr/src/lib/libnsl/dial/interface.c
↓ open down ↓ 18 lines elided ↑ open up ↑
  19   19   *
  20   20   * CDDL HEADER END
  21   21   */
  22   22  
  23   23  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  24   24  /*        All Rights Reserved   */
  25   25  
  26   26  /*
  27   27   * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  28   28   * Use is subject to license terms.
       29 + * Copyright 2014 Gary Mills
  29   30   */
  30   31  
  31      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  32      -
  33   32  /*
  34   33   * interface( label )
  35   34   *      provide alternate definitions for the I/O functions through global
  36   35   *      interfaces.
  37   36   */
  38   37  #include "mt.h"
  39   38  #include "uucp.h"
  40   39  #include <unistd.h>
  41   40  
  42   41  #ifdef TLI
↓ open down ↓ 237 lines elided ↑ open up ↑
 280  279                  DEBUG(5, fmt, t_errlist[t_errno]);
 281  280                  logent(s, t_errlist[t_errno]);
 282  281                  if (t_errno == TSYSERR) {
 283  282                          (void) strcpy(fmt, "tlicall: system error: %s\n");
 284  283                          DEBUG(5, fmt, strerror(errno));
 285  284                  } else if (t_errno == TLOOK) {
 286  285                          show_tlook(fd);
 287  286                  }
 288  287          } else {
 289  288                  (void) snprintf(fmt, sizeof (fmt),
 290      -                                        "unknown tli error %d", t_errno);
      289 +                    "unknown tli error %d", t_errno);
 291  290                  logent(s, fmt);
 292  291                  (void) snprintf(fmt, sizeof (fmt),
 293      -                                        "%s: unknown tli error %d", s, t_errno);
      292 +                    "%s: unknown tli error %d", s, t_errno);
 294  293                  DEBUG(5, fmt, 0);
 295  294                  (void) snprintf(fmt, sizeof (fmt), "%s: %%s\n", s);
 296  295                  DEBUG(5, fmt, strerror(errno));
 297  296          }
 298  297  }
 299  298  
 300  299  static void
 301  300  show_tlook(int fd)
 302  301  {
 303  302          int reason;
↓ open down ↓ 18 lines elided ↑ open up ↑
 322  321          DEBUG(5, "state is %s", msg);
 323  322          switch (reason = t_look(fd)) {
 324  323          case -1:                msg = (const char *)""; break;
 325  324          case 0:                 msg = (const char *)"NO ERROR"; break;
 326  325          case T_LISTEN:          msg = (const char *)"T_LISTEN"; break;
 327  326          case T_CONNECT:         msg = (const char *)"T_CONNECT"; break;
 328  327          case T_DATA:            msg = (const char *)"T_DATA";    break;
 329  328          case T_EXDATA:          msg = (const char *)"T_EXDATA"; break;
 330  329          case T_DISCONNECT:      msg = (const char *)"T_DISCONNECT"; break;
 331  330          case T_ORDREL:          msg = (const char *)"T_ORDREL"; break;
 332      -        case T_ERROR:           msg = (const char *)"T_ERROR"; break;
 333  331          case T_UDERR:           msg = (const char *)"T_UDERR"; break;
 334  332          default:                msg = (const char *)"UNKNOWN ERROR"; break;
 335  333          }
 336  334          DEBUG(4, " reason is %s\n", msg);
 337  335  
 338  336          if (reason == T_DISCONNECT) {
 339  337                  struct t_discon *dropped;
 340  338                  if (((dropped =
 341      -                        /* LINTED pointer cast */
 342      -                        (struct t_discon *)t_alloc(fd, T_DIS, T_ALL)) == 0) ||
 343      -                        (t_rcvdis(fd, dropped) == -1)) {
      339 +                    /* LINTED pointer cast */
      340 +                    (struct t_discon *)t_alloc(fd, T_DIS, T_ALL)) == 0) ||
      341 +                    (t_rcvdis(fd, dropped) == -1)) {
 344  342                          if (dropped)
 345  343                                  (void) t_free((char *)dropped, T_DIS);
 346  344                          return;
 347  345                  }
 348  346                  DEBUG(5, "disconnect reason #%d\n", dropped->reason);
 349  347                  (void) t_free((char *)dropped, T_DIS);
 350  348          }
 351  349  }
 352  350  #endif /*  TLIS  */
 353  351  #endif /*  TLI  */
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX