summaryrefslogtreecommitdiff
path: root/cleopatre/application/managerd
diff options
context:
space:
mode:
authorCĂ©line Buret2010-07-06 12:16:46 +0200
committerCeline Buret2010-09-28 17:10:09 +0200
commit2957b9ad0c2b964318b3216d063b2ba7610af45a (patch)
tree6febeee8f9a66f4de809dcfe98f7f313999db206 /cleopatre/application/managerd
parentb7313af2781d762de678a199096e0e23a46c4b17 (diff)
cleo/{app/{libspid,mgrd,plc},devkit/{doc,plcd,tests}}: closes #1723
Re-organize PLC Daemon for SET_KEY feature (from demo-2010-07 branch). Impacts on libspid, other daemons (managerd) and applications (plc). - modify specifications to communicate between daemons and applications, - re-organize plcd module, - add an assert macro in plcd module, - rename plc application into spidapp, - add a new libspid feature to handle inter-process signals, - modify managerd according to new communication with plcd. Updates relative to review are included in this commit.
Diffstat (limited to 'cleopatre/application/managerd')
-rw-r--r--cleopatre/application/managerd/src/managerd.c19
-rw-r--r--cleopatre/application/managerd/src/simple_connect.c16
2 files changed, 30 insertions, 5 deletions
diff --git a/cleopatre/application/managerd/src/managerd.c b/cleopatre/application/managerd/src/managerd.c
index 4944cf21b0..31ae831f34 100644
--- a/cleopatre/application/managerd/src/managerd.c
+++ b/cleopatre/application/managerd/src/managerd.c
@@ -74,13 +74,22 @@ static int managerd_process(struct managerd_ctx *ctx)
//Select
result = select(ctx->sock_br + 3, &readfds, NULL, NULL, &timeout);
- //Select error
- if(0 > result)
+ /* Select error */
+ if (0 > result)
{
- syslog(LOG_WARNING, "select failed (%s)", strerror(errno));
- return -1;
+ /* look for interrupt */
+ if (EINTR == errno)
+ {
+ /* reset errno */
+ errno = 0;
+ /* process interrupt */
+ }
+ else
+ {
+ syslog (LOG_WARNING, "select failed (%s)", strerror (errno));
+ return -1;
+ }
}
-
else if(0 == result)
{
//No reception coming, take time to manage simple connect
diff --git a/cleopatre/application/managerd/src/simple_connect.c b/cleopatre/application/managerd/src/simple_connect.c
index bcbec17ffc..485768304f 100644
--- a/cleopatre/application/managerd/src/simple_connect.c
+++ b/cleopatre/application/managerd/src/simple_connect.c
@@ -59,10 +59,26 @@ int simple_connect_event(struct managerd_ctx *ctx)
if(SC_BUTTON_ON == ctx->sc_gpio.gpioval.val)
{
libspid_config_write_item(LIBSPID_HPAV_INFO_PATH, LIBSPID_HPAV_INFO_LABEL_SC_BUTTON, "yes");
+
+ /* plc daemon needs to be informed */
+ if (LIBSPID_SUCCESS != libspid_system_file_update_warn (getpid(),
+ LIBSPID_HPAV_INFO_PATH))
+ {
+ syslog (LOG_WARNING, "libspid system file update warn failed");
+ return -1;
+ }
}
else
{
libspid_config_write_item(LIBSPID_HPAV_INFO_PATH, LIBSPID_HPAV_INFO_LABEL_SC_BUTTON, "no");
+
+ /* plc daemon needs to be informed */
+ if (LIBSPID_SUCCESS != libspid_system_file_update_warn (getpid(),
+ LIBSPID_HPAV_INFO_PATH))
+ {
+ syslog (LOG_WARNING, "libspid system file update warn failed");
+ return -1;
+ }
}
//Store GPIO value for next passage