Print this page
Fixes to allow compilation on OmniOS and OI
OS-3342+co
OS-1572
OS-327

@@ -769,12 +769,17 @@
                 return (-1);
         }
 
         while (fgets(inbuf, 1024, file) != NULL) {
                 if (retstr == NULL) {
-                        if (zlogp != &logsys)
+                        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,10 +1480,11 @@
                          */
                         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,10 +1506,11 @@
                         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,10 +1554,11 @@
                                 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,10 +1602,11 @@
                                 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;