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/libsmp/common/smp_subr.c
          +++ new/usr/src/lib/scsi/libsmp/common/smp_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) 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  
  28   32  #include <stddef.h>
  29   33  #include <stdlib.h>
  30   34  #include <string.h>
  31   35  #include <strings.h>
  32   36  #include <alloca.h>
  33   37  #include <stdio.h>
  34   38  #include <unistd.h>
  35   39  #include <dlfcn.h>
↓ open down ↓ 18 lines elided ↑ open up ↑
  54   58              "ABORT: \"%s\", line %d: assertion failed: %s\n", file, line, expr);
  55   59  
  56   60          msg = alloca(len + 1);
  57   61  
  58   62          (void) snprintf(msg, len + 1,
  59   63              "ABORT: \"%s\", line %d: assertion failed: %s\n", file, line, expr);
  60   64  
  61   65          (void) write(STDERR_FILENO, msg, strlen(msg));
  62   66  
  63   67          abort();
  64      -        _exit(1);
  65      -
  66   68          /*NOTREACHED*/
  67      -        return (0);
  68   69  }
  69   70  
  70   71  int
  71   72  smp_set_errno(smp_errno_t err)
  72   73  {
  73   74          _smp_errno = err;
  74   75          _smp_errmsg[0] = '\0';
  75   76  
  76   77          return (-1);
  77   78  }
↓ open down ↓ 167 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX