daemon: properly bury dead of room child app processes
This commit is contained in:
parent
bbb8d20a1e
commit
963d4ff0ec
|
@ -2,7 +2,7 @@
|
|||
/*
|
||||
* LADI Session Handler (ladish)
|
||||
*
|
||||
* Copyright (C) 2009 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
* Copyright (C) 2009, 2010 Nedko Arnaudov <nedko@arnaudov.name>
|
||||
*
|
||||
**************************************************************************
|
||||
* This file contains implementation of app supervisor object
|
||||
|
@ -291,7 +291,7 @@ bool ladish_app_supervisor_child_exit(ladish_app_supervisor_handle supervisor_ha
|
|||
app_ptr = list_entry(node_ptr, struct ladish_app, siblings);
|
||||
if (app_ptr->pid == pid)
|
||||
{
|
||||
log_info("exit of studio child '%s' detected.", app_ptr->name);
|
||||
log_info("exit of child '%s' detected.", app_ptr->name);
|
||||
|
||||
app_ptr->pid = 0;
|
||||
if (app_ptr->zombie)
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "../dbus_constants.h"
|
||||
#include "graph_dict.h"
|
||||
#include "../lib/wkports.h"
|
||||
#include "app_supervisor.h"
|
||||
|
||||
struct ladish_room
|
||||
{
|
||||
|
@ -219,6 +218,11 @@ ladish_graph_handle ladish_room_get_graph(ladish_room_handle room_handle)
|
|||
return room_ptr->graph;
|
||||
}
|
||||
|
||||
ladish_app_supervisor_handle ladish_room_get_app_supervisor(ladish_room_handle room_handle)
|
||||
{
|
||||
return room_ptr->app_supervisor;
|
||||
}
|
||||
|
||||
struct ladish_room_iterate_link_ports_context
|
||||
{
|
||||
void * context;
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
|
||||
#include "common.h"
|
||||
#include "graph.h"
|
||||
#include "app_supervisor.h"
|
||||
|
||||
typedef struct ladish_room_tag { int unused; } * ladish_room_handle;
|
||||
|
||||
|
@ -52,6 +53,7 @@ const char * ladish_room_get_opath(ladish_room_handle room_handle);
|
|||
bool ladish_room_get_template_uuid(ladish_room_handle room_handle, uuid_t uuid_ptr);
|
||||
void ladish_room_get_uuid(ladish_room_handle room_handle, uuid_t uuid_ptr);
|
||||
ladish_graph_handle ladish_room_get_graph(ladish_room_handle room_handle);
|
||||
ladish_app_supervisor_handle ladish_room_get_app_supervisor(ladish_room_handle room_handle);
|
||||
|
||||
bool
|
||||
ladish_room_iterate_link_ports(
|
||||
|
|
|
@ -500,10 +500,28 @@ void studio_uninit(void)
|
|||
|
||||
void studio_on_child_exit(pid_t pid)
|
||||
{
|
||||
if (!ladish_app_supervisor_child_exit(g_studio.app_supervisor, pid))
|
||||
struct list_head * node_ptr;
|
||||
ladish_room_handle room;
|
||||
ladish_app_supervisor_handle room_app_supervisor;
|
||||
|
||||
if (ladish_app_supervisor_child_exit(g_studio.app_supervisor, pid))
|
||||
{
|
||||
log_error("non-studio child exit detected. pid is %llu", (unsigned long long)pid);
|
||||
return;
|
||||
}
|
||||
|
||||
list_for_each(node_ptr, &g_studio.rooms)
|
||||
{
|
||||
room = ladish_room_from_list_node(node_ptr);
|
||||
room_app_supervisor = ladish_room_get_app_supervisor(room);
|
||||
ASSERT(room_app_supervisor != NULL);
|
||||
|
||||
if (ladish_app_supervisor_child_exit(room_app_supervisor, pid))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
log_error("unknown child exit detected. pid is %llu", (unsigned long long)pid);
|
||||
}
|
||||
|
||||
bool studio_is_loaded(void)
|
||||
|
|
Loading…
Reference in New Issue