Obsolete golang-120
[oi-userland.git] / components / library / ConsoleKit / patches / 28-solaris-support.patch
blobf1d83c93ef43085ae5e3273e6a2420143e8b9ff8
1 --- ConsoleKit-0.4.1/src/ck-sysdeps-solaris.c 2018-01-16 08:39:38.810256813 +0000
2 +++ ConsoleKit-0.4.1/src/ck-sysdeps-solaris.c 2018-01-16 08:39:34.260866334 +0000
3 @@ -29,6 +29,7 @@
4 #include <sys/types.h>
5 #include <sys/stat.h>
6 #include <sys/ioctl.h>
7 +#include <sys/uadmin.h>
9 #ifdef HAVE_SYS_VT_H
10 #include <sys/vt.h>
11 @@ -533,15 +534,17 @@
12 gboolean
13 ck_system_can_suspend (void)
15 - /* TODO: not implemented */
16 - return FALSE;
17 + gboolean can_suspend;
18 + can_suspend = ((uadmin(A_FREEZE, AD_CHECK_SUSPEND_TO_RAM, 0) == 0)? TRUE: FALSE) ;
19 + return can_suspend;
22 gboolean
23 ck_system_can_hibernate (void)
25 - /* TODO: not implemented */
26 - return FALSE;
27 + gboolean can_hibernate;
28 + can_hibernate = ((uadmin(A_FREEZE, AD_CHECK_SUSPEND_TO_DISK, 0) == 0)? TRUE: FALSE) ;
29 + return can_hibernate;
32 gboolean
33 --- ConsoleKit-0.4.1/tools/solaris/ck-system-suspend.1 2018-01-16 08:42:06.323997398 +0000
34 +++ ConsoleKit-0.4.1/tools/solaris/ck-system-suspend 2018-01-16 08:44:06.015209511 +0000
35 @@ -1,4 +1,8 @@
36 #!/bin/sh
38 -# FIXME: Implement this
39 -exit 1
40 +RET=1
41 +if [ -x "/usr/sbin/uadmin" ] ; then
42 + /usr/sbin/uadmin 3 20
43 + RET=$?
44 +fi
45 +exit $RET
46 --- ConsoleKit-0.4.1/tools/solaris/ck-system-hibernate.1 2018-01-16 08:45:01.320015702 +0000
47 +++ ConsoleKit-0.4.1/tools/solaris/ck-system-hibernate 2018-01-16 08:45:40.499810609 +0000
48 @@ -1,4 +1,8 @@
49 #!/bin/sh
51 -# FIXME: Implement this
52 -exit 1
53 +RET=1
54 +if [ -x "/usr/sbin/uadmin" ] ; then
55 + /usr/sbin/uadmin 3 0
56 + RET=$?
57 +fi
58 +exit $RET