lkml.org 
[lkml]   [2004]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    SubjectSuspend 2 merge: 7/51: Reboot handler hook.
    From
    Date
    Nice and simple.

    We override swsusp's hook with the suspend2 one. It's not that I want to
    step on Pavel's toes. Rather, people who go to the trouble of applying
    suspend2, probably want to use it :>


    diff -ruN 300-reboot-handler-hook-old/kernel/sys.c 300-reboot-handler-hook-new/kernel/sys.c
    --- 300-reboot-handler-hook-old/kernel/sys.c 2004-11-03 21:51:17.000000000 +1100
    +++ 300-reboot-handler-hook-new/kernel/sys.c 2004-11-06 09:23:26.887002384 +1100
    @@ -502,10 +502,14 @@
    machine_restart(buffer);
    break;

    -#ifdef CONFIG_SOFTWARE_SUSPEND
    +#ifdef CONFIG_SOFTWARE_SUSPEND2
    case LINUX_REBOOT_CMD_SW_SUSPEND:
    {
    - int ret = software_suspend();
    + int ret = -EINVAL;
    + if (!(test_suspend_state(SUSPEND_DISABLED))) {
    + suspend_try_suspend();
    + ret = 0;
    + }
    unlock_kernel();
    return ret;
    }

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 14:08    [W:2.060 / U:0.088 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site