kexec-tools-001-smaller-reboot.patch 618 B

123456789101112131415161718192021222324252627
  1. --- kexec-tools-1.101.orig/kexec/kexec.c 2006-09-20 04:39:38.000000000 +0200
  2. +++ kexec-tools-1.101/kexec/kexec.c 2007-01-22 15:58:30.000000000 +0100
  3. @@ -630,19 +630,14 @@ int k_unload (unsigned long kexec_flags)
  4. */
  5. static int my_shutdown(void)
  6. {
  7. - char *args[8];
  8. - int i = 0;
  9. + char *args[2];
  10. - args[i++] = "shutdown";
  11. - args[i++] = "-r";
  12. - args[i++] = "now";
  13. - args[i++] = NULL;
  14. + args[0] = "reboot";
  15. + args[1] = NULL;
  16. - execv("/sbin/shutdown", args);
  17. - execv("/etc/shutdown", args);
  18. - execv("/bin/shutdown", args);
  19. + execv("/sbin/reboot", args);
  20. - perror("shutdown");
  21. + perror("reboot");
  22. return -1;
  23. }