Print this page
graph

*** 3572,3581 **** --- 3572,3597 ---- */ (void) fork_with_timeout("/usr/bin/pkill -TERM -v -u 0,1,15", 1, 5); (void) fork_with_timeout("/usr/bin/pkill -KILL -v -u 0,1,15", 1, 5); } + static int + exec_cmd(char * invoke, char * output) + { + FILE * cmd = popen(invoke, "r"); + if (! cmd) + return 0; + fgets(output, 512, cmd); + if (! *output) { + pclose(cmd); + return 0; + } + output[strlen(output) - 2] = '\0'; + pclose(cmd); + return 1; + } + static void do_uadmin(void) { const char * const resetting = "/etc/svc/volatile/resetting"; int fd;
*** 3638,3649 **** */ if (halting == AD_FASTREBOOT) { #if defined(__i386) int rc; ! if ((rc = grub_get_boot_args(&fbarg, NULL, ! GRUB_ENTRY_DEFAULT)) == 0) { mdep = (uintptr_t)&fbarg.gba_bootargs; } else { /* * Failed to read GRUB menu, fall back to normal reboot */ --- 3654,3665 ---- */ if (halting == AD_FASTREBOOT) { #if defined(__i386) int rc; ! if ((rc = exec_cmd("/sbin/grubadm --number -1 --get-opts", ! fbarg.gba_bootargs)) == 0) { mdep = (uintptr_t)&fbarg.gba_bootargs; } else { /* * Failed to read GRUB menu, fall back to normal reboot */