Print this page
Fixes to allow compilation on OmniOS and OI
OS-3342+co
OS-1572
OS-327
        
*** 769,780 ****
                  return (-1);
          }
  
          while (fgets(inbuf, 1024, file) != NULL) {
                  if (retstr == NULL) {
!                         if (zlogp != &logsys)
                                  zerror(zlogp, B_FALSE, "%s", inbuf);
                  } else {
                          char *p;
  
                          rd_cnt += 1024 - 1;
                          if ((p = realloc(*retstr, rd_cnt + 1024)) == NULL) {
--- 769,785 ----
                  return (-1);
          }
  
          while (fgets(inbuf, 1024, file) != NULL) {
                  if (retstr == NULL) {
!                         if (zlogp != &logsys) {
!                                 int last = strlen(inbuf) - 1;
! 
!                                 if (inbuf[last] == '\n')
!                                         inbuf[last] = '\0';
                                  zerror(zlogp, B_FALSE, "%s", inbuf);
+                         }
                  } else {
                          char *p;
  
                          rd_cnt += 1024 - 1;
                          if ((p = realloc(*retstr, rd_cnt + 1024)) == NULL) {
*** 1475,1484 ****
--- 1480,1490 ----
                           */
                          zerror(zlogp, B_FALSE, "zone is already ready");
                          rval = 0;
                          break;
                  case Z_BOOT:
+                 case Z_FORCEBOOT:
                          (void) strlcpy(boot_args, zargp->bootbuf,
                              sizeof (boot_args));
                          eventstream_write(Z_EVT_ZONE_BOOTING);
                          rval = zone_bootup(zlogp, zargp->bootbuf, zstate);
                          audit_put_record(zlogp, uc, rval, "boot");
*** 1500,1509 ****
--- 1506,1516 ----
                          break;
                  case Z_SHUTDOWN:
                  case Z_REBOOT:
                  case Z_NOTE_UNINSTALLING:
                  case Z_MOUNT:
+                 case Z_FORCEMOUNT:
                  case Z_UNMOUNT:
                          if (kernelcall) /* Invalid; can't happen */
                                  abort();
                          zerror(zlogp, B_FALSE, "%s operation is invalid "
                              "for zones in state '%s'", z_cmd_name(cmd),
*** 1547,1556 ****
--- 1554,1564 ----
                                  eventstream_write(Z_EVT_ZONE_READIED);
                          else
                                  eventstream_write(Z_EVT_ZONE_HALTED);
                          break;
                  case Z_BOOT:
+                 case Z_FORCEBOOT:
                          /*
                           * We could have two clients racing to boot this
                           * zone; the second client loses, but his request
                           * doesn't fail, since the zone is now in the desired
                           * state.
*** 1594,1603 ****
--- 1602,1612 ----
                                  wait_shut = B_TRUE;
                          }
                          break;
                  case Z_NOTE_UNINSTALLING:
                  case Z_MOUNT:
+                 case Z_FORCEMOUNT:
                  case Z_UNMOUNT:
                          zerror(zlogp, B_FALSE, "%s operation is invalid "
                              "for zones in state '%s'", z_cmd_name(cmd),
                              zone_state_str(zstate));
                          rval = -1;