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/libses/common/ses_subr.c
          +++ new/usr/src/lib/scsi/libses/common/ses_subr.c
↓ open down ↓ 16 lines elided ↑ open up ↑
  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 2008 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27      -#pragma ident   "%Z%%M% %I%     %E% SMI"
       27 +/*
       28 + * Copyright 2019 Joyent, Inc.
       29 + */
  28   30  
  29   31  #include <scsi/libses.h>
  30   32  #include "ses_impl.h"
  31   33  
  32   34  __thread ses_errno_t _ses_errno;
  33   35  __thread char _ses_errmsg[1024];
  34   36  __thread char _ses_nverr_member[256];
  35   37  
  36   38  static void ses_vpanic(const char *, va_list) __NORETURN;
  37   39  
↓ open down ↓ 9 lines elided ↑ open up ↑
  47   49          (void) vsnprintf(msg + len, sizeof (msg) - len, fmt, ap);
  48   50  
  49   51          if (strchr(fmt, '\n') == NULL) {
  50   52                  len = strlen(msg);
  51   53                  (void) snprintf(msg + len, sizeof (msg) - len, ": %s\n",
  52   54                      strerror(oserr));
  53   55          }
  54   56  
  55   57          (void) write(STDERR_FILENO, msg, strlen(msg));
  56   58  
  57      -abort:
  58   59          abort();
  59      -        _exit(1);
  60   60  }
  61   61  
  62   62  /*PRINTFLIKE1*/
  63   63  void
  64   64  ses_panic(const char *fmt, ...)
  65   65  {
  66   66          va_list ap;
  67   67  
  68   68          va_start(ap, fmt);
  69   69          ses_vpanic(fmt, ap);
↓ open down ↓ 307 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX