Comment 30 for bug 1178373

Revision history for this message
In , Guido Berhoerster (gber) wrote :

Created attachment 5117
support suspend/hibernate through logind

(In reply to Lionel Le Folgoc from comment #7)
> Created attachment 5085 [details]
> Add logind runtime detection
>
> I took the patch from this bug report and from Bug #10076 to combine them
> (suspend/hibernate support + logind runtime detection). It could probably be
> done in a nicer way, but it seems to work fine.
>
> (I tested with the 4.10.1 release tarball so it won't apply as is over git,
> e.g. replace configure.ac with configure.ac.in in the patch.)

Your patch calls g_object_unref() on potentially uninitialized or NULL pointers (shutdown->consolekit and shutdown->systemd in xfce4-session/xfsm-shutdown.c:xfsm_shutdown_finalize()). The attached patch fixes that and also moves the LOGIND_RUNNING macro into xfce4-session/xfsm-systemd.h and caches its result in xfce4-session/xfsm-shutdown.c. It applies to current git.