1N/A/*************************************************************************** 1N/A * Copyright (C) 2006 Sjoerd Simons, <sjoerd@luon.net> 1N/A * Licensed under the Academic Free License version 2.1 1N/A * This program is free software; you can redistribute it and/or modify 1N/A * it under the terms of the GNU General Public License as published by 1N/A * the Free Software Foundation; either version 2 of the License, or 1N/A * (at your option) any later version. 1N/A * This program is distributed in the hope that it will be useful, 1N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 1N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1N/A * GNU General Public License for more details. 1N/A * You should have received a copy of the GNU General Public License 1N/A * along with this program; if not, write to the Free Software 1N/A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 1N/A **************************************************************************/ 1N/A/* Successful run of the program */ 1N/A/* Process was killed because of running too long */ 1N/A/* Failed to start for some reason */ 1N/A/* Killed on purpose, e.g. hal_util_kill_device_helpers */ 1N/A /* Remove to the hashtable */ 1N/A /* The hash table will take care to not leak the dupped string */ 1N/A /* We send it a kill, so ignore */ 1N/A /* Check if it was a normal exit */ 1N/A /* No not normal termination ? crash ? */ 1N/A /* Need to read stderr */ 1N/A /* emit a signal that this PID exited */ 1N/A "org.freedesktop.HalRunner",
1N/A "StartedProcessExited");
1N/A /* Time is up, kill the process, send reply that it was killed! 1N/A * Don't wait for exit, because it could hang in state D 1N/A /* Ensure the timeout is not removed in the delete */ 1N/A /* So the exit watch will know it's killed in case it runs*/ 1N/A /* Search for the program in the dirs where it's allowed to be */ 1N/A /* Replace program in argv[0] with the full path */ 1N/A/* Run the given request and reply it's result on msg */ 1N/A printf(
"Warning: Error while wite r->input (%s) to stdin_v.\n", r->
input);
1N/A /* Add watch for exit of the program */ 1N/A /* Add timeout if needed */ 1N/A /* Add to the hashtable */ 1N/A /* The hash table will take care to not leak the dupped string */ 1N/A /* send back PID if requested.. and only emit StartedProcessExited in this case */ 1N/A /* Remove the timeout watch */ 1N/A /* So the exit watch will know it's killed in case it runs */ 1N/A/* Kill all running request for a udi */ 1N/A/* Kill all running request*/