Lines Matching defs:rd
67 del_run_data(run_data *rd)
69 if (rd == NULL)
72 del_run_request(rd->r);
73 if (rd->msg)
74 dbus_message_unref(rd->msg);
76 g_spawn_close_pid(rd->pid);
78 if (rd->stderr_v >= 0)
79 close(rd->stderr_v);
81 if (rd->timeout != 0)
82 g_source_remove(rd->timeout);
84 g_free(rd);
133 remove_run_data(run_data *rd)
137 if (rd->r->is_singleton) {
138 singletons = g_list_remove(singletons, rd);
141 list = (GList *)g_hash_table_lookup(udi_hash, rd->r->udi);
142 list = g_list_remove(list, rd);
144 g_hash_table_insert(udi_hash, g_strdup(rd->r->udi), list);
151 run_data *rd = (run_data *)data;
155 pid, WEXITSTATUS(status), WIFSIGNALED(status), rd->r->argv[0]);
156 rd->watch = 0;
157 if (rd->sent_kill == TRUE) {
159 del_run_data(rd);
165 send_reply(rd->con, rd->msg, HALD_RUN_FAILED, 0, NULL);
169 if (rd->stderr_v >= 0) {
171 error = get_string_array_from_fd(rd->stderr_v);
172 close(rd->stderr_v);
173 rd->stderr_v = -1;
175 if (rd->msg != NULL)
176 send_reply(rd->con, rd->msg, HALD_RUN_SUCCESS, WEXITSTATUS(status), error);
180 remove_run_data (rd);
183 if(rd->con != NULL && rd->emit_pid_exited) {
185 gint64 ppid = rd->pid;
192 dbus_connection_send(rd->con, signal, NULL);
195 del_run_data(rd);
200 run_data *rd = (run_data *)data;
204 kill(rd->pid, SIGTERM);
206 rd->timeout = 0;
208 rd->sent_kill = TRUE;
210 send_reply(rd->con, rd->msg, HALD_RUN_TIMEOUT, 0, NULL);
211 remove_run_data (rd);
250 run_data *rd = NULL;
290 rd = g_new0(run_data,1);
291 g_assert(rd != NULL);
292 rd->r = r;
293 rd->msg = msg;
297 rd->con = con;
298 rd->pid = pid;
299 rd->stderr_v = stderr_v;
300 rd->sent_kill = FALSE;
303 rd->watch = g_child_watch_add(pid, run_exited, rd);
307 rd->timeout = g_timeout_add(r->timeout, run_timedout, rd);
309 rd->timeout = 0;
312 singletons = g_list_prepend(singletons, rd);
316 list = g_list_prepend(list, rd);
325 rd->emit_pid_exited = TRUE;
333 run_data *rd = (run_data *)data;
335 kill(rd->pid, SIGTERM);
336 printf("Sent kill to %d\n", rd->pid);
337 if (rd->timeout != 0) {
339 g_source_remove(rd->timeout);
340 rd->timeout = 0;
344 rd->sent_kill = TRUE;
346 if (rd->msg != NULL)
347 send_reply(rd->con, rd->msg, HALD_RUN_KILLED, 0, NULL);