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/cmd/fs.d/reparsed/reparsed.c
          +++ new/usr/src/cmd/fs.d/reparsed/reparsed.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   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   */
  25   25  
  26   26  /*
  27      - * Copyright (c) 2018, Joyent, Inc.
       27 + * Copyright 2019 Joyent, Inc.
  28   28   */
  29   29  
  30   30  /*
  31   31   * Reparsed daemon
  32   32   */
  33   33  
  34   34  #include <stdio.h>
  35   35  #include <stdio_ext.h>
  36   36  #include <stdlib.h>
  37   37  #include <unistd.h>
↓ open down ↓ 142 lines elided ↑ open up ↑
 180  180  
 181  181          /*
 182  182           * Clear basic privileges not required by reparsed.
 183  183           */
 184  184          __fini_daemon_priv(PRIV_PROC_FORK, PRIV_PROC_EXEC, PRIV_PROC_SESSION,
 185  185              PRIV_FILE_LINK_ANY, PRIV_PROC_INFO, (char *)NULL);
 186  186  
 187  187          return (start_reparsed_svcs());
 188  188  }
 189  189  
 190      -static void
      190 +__NORETURN static void
 191  191  reparsed_door_call_error(int error, int buflen)
 192  192  {
 193  193          reparsed_door_res_t rpd_res;
 194  194  
 195  195          memset(&rpd_res, 0, sizeof (reparsed_door_res_t));
 196  196          rpd_res.res_status = error;
 197  197          rpd_res.res_len = buflen;
 198  198          (void) door_return((char *)&rpd_res,
 199  199              sizeof (reparsed_door_res_t), NULL, 0);
 200  200  
↓ open down ↓ 146 lines elided ↑ open up ↑
 347  347                  syslog(LOG_ERR, "Unable to fattach door %s", REPARSED_DOOR);
 348  348                  (void) close(doorfd);
 349  349                  (void) close(dfd);
 350  350                  return (1);
 351  351          }
 352  352          (void) close(dfd);
 353  353  
 354  354          /*
 355  355           * Wait for incoming calls
 356  356           */
 357      -        /*CONSTCOND*/
 358  357          while (1)
 359  358                  (void) pause();
 360      -
 361      -        syslog(LOG_ERR, "Door server exited");
 362      -        return (10);
 363  359  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX