ecore: notify systemd automatically when the main loop is starting.

This commit is contained in:
Cedric Bail 2013-03-10 20:53:58 +09:00
parent cf26a36fec
commit 29299ea2ab
4 changed files with 14 additions and 5 deletions

View File

@ -2,6 +2,7 @@
* Eeze: add a dummy implementation of libmount when it is not available. * Eeze: add a dummy implementation of libmount when it is not available.
* Ecore_Con: add systemd socket activation support (ECORE_CON_SOCKET_ACTIVATE). * Ecore_Con: add systemd socket activation support (ECORE_CON_SOCKET_ACTIVATE).
* Ecore: notify systemd that we are ready as soon as the main loop is running.
2013-03-08 Igor Murzov 2013-03-08 Igor Murzov

1
NEWS
View File

@ -73,6 +73,7 @@ Additions:
* Ecore_x: Add manual render code before deiconify * Ecore_x: Add manual render code before deiconify
* Eeze: Add a dummy libmount replacement for when libmount is not there. * Eeze: Add a dummy libmount replacement for when libmount is not there.
* Ecore_Con: Add systemd socket activation support (ECORE_CON_SOCKET_ACTIVATE). * Ecore_Con: Add systemd socket activation support (ECORE_CON_SOCKET_ACTIVATE).
* Ecore: notify systemd that we are ready as soon as the main loop is running.
Deprecations: Deprecations:
* ecore_x: * ecore_x:

View File

@ -137,6 +137,7 @@ case "$host_os" in
;; ;;
esac esac
want_systemd="no"
have_wince="no" have_wince="no"
have_win32="no" have_win32="no"
have_windows="no" have_windows="no"
@ -158,6 +159,7 @@ case "$host_os" in
;; ;;
linux*) linux*)
have_linux="yes" have_linux="yes"
want_systemd="yes"
;; ;;
esac esac
@ -1735,6 +1737,9 @@ if test "x${have_glib}" = "xno"; then
want_g_main_loop="no" want_g_main_loop="no"
fi fi
EFL_OPTIONAL_DEPEND_PKG([ECORE], [${want_systemd}], [SYSTEMD], [libsystemd-daemon])
EFL_ADD_FEATURE([ECORE], [systemd-daemon], [${want_systemd}])
EFL_ADD_FEATURE([ECORE], [glib]) EFL_ADD_FEATURE([ECORE], [glib])
EFL_ADD_FEATURE([ECORE], [g-main-loop]) EFL_ADD_FEATURE([ECORE], [g-main-loop])
@ -1885,26 +1890,21 @@ want_ecore_con_local_sockets="yes"
want_ecore_con_abstract_sockets="yes" want_ecore_con_abstract_sockets="yes"
if test "${have_wince}" = "yes"; then if test "${have_wince}" = "yes"; then
want_systemd="no"
want_curl="no" want_curl="no"
want_cares="no" want_cares="no"
want_ecore_con_local_sockets="no" want_ecore_con_local_sockets="no"
want_ecore_con_abstract_sockets="no" want_ecore_con_abstract_sockets="no"
elif test "${have_win32}" = "yes"; then elif test "${have_win32}" = "yes"; then
want_systemd="no"
want_cares="yes" want_cares="yes"
want_ecore_con_abstract_sockets="no" want_ecore_con_abstract_sockets="no"
elif test "${have_darwin}" = "yes"; then elif test "${have_darwin}" = "yes"; then
want_systemd="no"
want_cares="no" want_cares="no"
want_ecore_con_abstract_sockets="no" want_ecore_con_abstract_sockets="no"
elif test "${have_ps3}" = "yes"; then elif test "${have_ps3}" = "yes"; then
want_systemd="no"
want_cares="no" want_cares="no"
want_ecore_con_local_sockets="no" want_ecore_con_local_sockets="no"
want_ecore_con_abstract_sockets="no" want_ecore_con_abstract_sockets="no"
else else
want_systemd="yes"
want_cares="no" want_cares="no"
fi fi

View File

@ -25,6 +25,10 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/time.h> #include <sys/time.h>
#ifdef HAVE_SYSTEMD
# include <systemd/sd-daemon.h>
#endif
#ifdef _MSC_VER #ifdef _MSC_VER
# include <float.h> # include <float.h>
#endif #endif
@ -949,6 +953,9 @@ EAPI void
ecore_main_loop_begin(void) ecore_main_loop_begin(void)
{ {
EINA_MAIN_LOOP_CHECK_RETURN; EINA_MAIN_LOOP_CHECK_RETURN;
#ifdef HAVE_SYSTEMD
sd_notify(0, "READY=1");
#endif
#ifndef USE_G_MAIN_LOOP #ifndef USE_G_MAIN_LOOP
_ecore_lock(); _ecore_lock();
in_main_loop++; in_main_loop++;