Print this page
10099 libfakekernel vpanic() should cast away assfail()

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libfakekernel/common/printf.c
          +++ new/usr/src/lib/libfakekernel/common/printf.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   * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
  23   23   * Copyright (c) 2012 by Delphix. All rights reserved.
  24   24   * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
  25   25   * Copyright 2017 RackTop Systems.
       26 + * Copyright (c) 2018, Joyent, Inc.
  26   27   */
  27   28  
  28   29  #include <sys/param.h>
  29   30  #include <sys/types.h>
  30   31  #include <sys/varargs.h>
  31   32  #include <sys/systm.h>
  32   33  #include <sys/cmn_err.h>
  33   34  #include <sys/log.h>
  34   35  
  35   36  #include <fakekernel.h>
↓ open down ↓ 72 lines elided ↑ open up ↑
 108  109          va_list tmpargs;
 109  110  
 110  111          panicstr = (char *)fmt;
 111  112          va_copy(panicargs, adx);
 112  113  
 113  114          va_copy(tmpargs, adx);
 114  115          fakekernel_cprintf(fmt, tmpargs, SL_FATAL, "fatal: ", "\n");
 115  116  
 116  117          /* Call libc`assfail() so that mdb ::status works */
 117  118          (void) vsnprintf(panicbuf, sizeof (panicbuf), fmt, adx);
 118      -        assfail(panicbuf, "(panic)", 0);
      119 +        (void) assfail(panicbuf, "(panic)", 0);
 119  120  
 120  121          abort();        /* avoid "noreturn" warnings */
 121  122  }
 122  123  
 123  124  void
 124  125  panic(const char *fmt, ...)
 125  126  {
 126  127          va_list adx;
 127  128  
 128  129          va_start(adx, fmt);
↓ open down ↓ 37 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX