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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/ktli/t_krcvudat.c
          +++ new/usr/src/uts/common/ktli/t_krcvudat.c
↓ open down ↓ 11 lines elided ↑ open up ↑
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
       22 + * Copyright 2014 Gary Mills
  22   23   * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  23   24   * Use is subject to license terms.
  24   25   */
  25   26  
  26   27  /*      Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
  27   28  /*        All Rights Reserved   */
  28   29  
  29   30  /*
  30   31   * University Copyright- Copyright (c) 1982, 1986, 1988
  31   32   * The Regents of the University of California
  32   33   * All Rights Reserved
  33   34   *
  34   35   * University Acknowledgment- Portions of this document are derived from
  35   36   * software developed by the University of California, Berkeley, and its
  36   37   * contributors.
  37   38   */
  38   39  
  39      -#pragma ident   "%Z%%M% %I%     %E% SMI"
  40      -
  41   40  /*
  42   41   * Kernel TLI-like function to read a datagram off of a
  43   42   * transport endpoints stream head.
  44   43   *
  45   44   * Returns:
  46   45   *      0       On success or positive error code.
  47   46   *              On sucess, type is set to:
  48   47   *      T_DATA          If normal data has been received
  49   48   *      T_UDERR         If an error indication has been received,
  50   49   *                      in which case uderr contains the unitdata
  51   50   *                      error number.
  52      - *      T_ERROR
  53   51   */
  54   52  
  55   53  #include <sys/param.h>
  56   54  #include <sys/types.h>
  57   55  #include <sys/user.h>
  58   56  #include <sys/file.h>
  59   57  #include <sys/errno.h>
  60   58  #include <sys/stream.h>
  61   59  #include <sys/strsubr.h>
  62   60  #include <sys/vnode.h>
↓ open down ↓ 224 lines elided ↑ open up ↑
 287  285                              pptr->type);
 288  286                          error = EPROTO;
 289  287                          freemsg(bp);
 290  288                          break;
 291  289                  }
 292  290                  break;
 293  291  
 294  292          case M_FLUSH:
 295  293                  KTLILOG(1, "t_krcvudata: tli_recv returned M_FLUSH\n", 0);
 296  294                  freemsg(bp);
 297      -                *type = T_ERROR;
      295 +                error = EBADMSG;
 298  296                  break;
 299  297  
 300  298          default:
 301  299                  KTLILOG(1, "t_krcvudata: unknown message type %x\n",
 302  300                      bp->b_datap->db_type);
 303  301                  freemsg(bp);
 304      -                *type = T_ERROR;
      302 +                error = EBADMSG;
 305  303                  break;
 306  304          }
 307  305  
 308  306          return (error);
 309  307  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX