Print this page
OS-1572 Explicitly handle all possible enum values in switches
Reviewed by: Robert Mustacchi <rm@joyent.com>

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/dlmgmtd/dlmgmt_main.c
          +++ new/usr/src/cmd/dlmgmtd/dlmgmt_main.c
↓ open down ↓ 247 lines elided ↑ open up ↑
 248  248                      sizeof (status)) < 0)
 249  249                          continue;
 250  250                  switch (status) {
 251  251                          case ZONE_IS_SHUTTING_DOWN:
 252  252                          case ZONE_IS_EMPTY:
 253  253                          case ZONE_IS_DOWN:
 254  254                          case ZONE_IS_DYING:
 255  255                          case ZONE_IS_DEAD:
 256  256                                  /* FALLTHRU */
 257  257                                  continue;
      258 +                        default:
      259 +                                break;
 258  260                  }
 259  261                  if ((res = dlmgmt_zone_init(zids[i])) != 0) {
 260  262                          (void) fprintf(stderr, "zone (%ld) init error %s",
 261  263                              zids[i], strerror(res));
 262  264                          dlmgmt_log(LOG_ERR, "zone (%d) init error %s",
 263  265                              zids[i], strerror(res));
 264  266                  }
 265  267          }
 266  268          free(zids);
 267  269          return (0);
↓ open down ↓ 306 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX