Print this page
10703 smatch unreachable code checking needs reworking
Reviewed by: Toomas Soome <tsoome@me.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/scsi/libscsi/common/scsi_subr.c
          +++ new/usr/src/lib/scsi/libscsi/common/scsi_subr.c
↓ open down ↓ 15 lines elided ↑ open up ↑
  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   22  /*
  23   23   * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24   */
  25   25  
       26 +/*
       27 + * Copyright 2019 Joyent, Inc.
       28 + */
       29 +
  26   30  #include <sys/types.h>
  27   31  #include <sys/scsi/generic/commands.h>
  28   32  #include <sys/scsi/impl/spc3_types.h>
  29   33  
  30   34  #include <stddef.h>
  31   35  #include <stdlib.h>
  32   36  #include <string.h>
  33   37  #include <strings.h>
  34   38  #include <alloca.h>
  35   39  #include <stdio.h>
↓ open down ↓ 13 lines elided ↑ open up ↑
  49   53              "ABORT: \"%s\", line %d: assertion failed: %s\n", file, line, expr);
  50   54  
  51   55          msg = alloca(len + 1);
  52   56  
  53   57          (void) snprintf(msg, len + 1,
  54   58              "ABORT: \"%s\", line %d: assertion failed: %s\n", file, line, expr);
  55   59  
  56   60          (void) write(STDERR_FILENO, msg, strlen(msg));
  57   61  
  58   62          abort();
  59      -        _exit(1);
  60      -
  61   63          /*NOTREACHED*/
  62      -        return (0);
  63   64  }
  64   65  
  65   66  int
  66   67  libscsi_set_errno(libscsi_hdl_t *hp, libscsi_errno_t err)
  67   68  {
  68   69          hp->lsh_errno = err;
  69   70          hp->lsh_errmsg[0] = '\0';
  70   71  
  71   72          return (-1);
  72   73  }
↓ open down ↓ 277 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX