Changes: close connection with invoker if --wait-term param is not used

pull/1/head
Alexey Shilov 15 years ago
parent a03eb26083
commit bb8223f4e4

@ -387,7 +387,7 @@ static unsigned int get_delay(char *delay_arg)
return delay; return delay;
} }
static void invoke(int prog_argc, char **prog_argv, char *prog_name, static int invoke(int prog_argc, char **prog_argv, char *prog_name,
enum APP_TYPE app_type, int magic_options, bool wait_term) enum APP_TYPE app_type, int magic_options, bool wait_term)
{ {
if (prog_name && prog_argv) if (prog_name && prog_argv)
@ -536,7 +536,7 @@ int main(int argc, char *argv[])
} }
// Send commands to the launcher daemon // Send commands to the launcher daemon
info("Invoking execution: '%s'\n", prog_name); info("Invoking execution: '%s'\n", prog_name);
invoke(prog_argc, prog_argv, prog_name, app_type, magic_options, wait_term); int ret_val = invoke(prog_argc, prog_argv, prog_name, app_type, magic_options, wait_term);
// Sleep for delay before exiting // Sleep for delay before exiting
if (delay) if (delay)
@ -546,5 +546,5 @@ int main(int argc, char *argv[])
sleep(delay); sleep(delay);
} }
return 0; return ret_val;
} }

@ -55,13 +55,13 @@ bool Booster::readCommand()
// Accept a new invocation. // Accept a new invocation.
if (conn.acceptConn()) if (conn.acceptConn())
{ {
if (conn.receiveApplicationData(m_app)) bool res = conn.receiveApplicationData(m_app);
if (!conn.reportAppExitStatus())
{ {
return true; conn.closeConn();
} }
return true;
// Close connection
conn.closeConn();
} }
return false; return false;

@ -519,3 +519,8 @@ bool Connection::receiveApplicationData(AppData & rApp)
return true; return true;
} }
bool Connection::reportAppExitStatus()
{
return m_sendPid;
}

@ -75,6 +75,10 @@ public:
//! \brief Receive application data to rApp. //! \brief Receive application data to rApp.
bool receiveApplicationData(AppData & rApp); bool receiveApplicationData(AppData & rApp);
//! \brief Return true if invoker wait for process exit status
bool reportAppExitStatus();
/*! \brief Initialize a file socket. /*! \brief Initialize a file socket.
* \param socketId Path to the socket file * \param socketId Path to the socket file
*/ */

Loading…
Cancel
Save