Changes: fixed wait bit passing in magic_options in case of --no-wait,

failing to unlink /tmp/boostX logs an error message.

RevBy: Alexey Shilov
pull/1/head
Antti Kervinen 15 years ago
parent 6669cb1241
commit 7295bd3c0a

@ -264,7 +264,7 @@ static uint32_t invoker_recv_exit(int fd)
}
// Sends magic number / protocol version
static void invoker_send_magic(int fd, int options)
static void invoker_send_magic(int fd, uint32_t options)
{
// Send magic.
invoke_send_msg(fd, INVOKER_MSG_MAGIC | INVOKER_MSG_MAGIC_VERSION | options);
@ -476,7 +476,7 @@ void invoke_fallback(char **prog_argv, char *prog_name, bool wait_term)
// "normal" invoke through a socket connection
int invoke_remote(int fd, int prog_argc, char **prog_argv, char *prog_name,
int magic_options, bool wait_term, unsigned int respawn_delay)
uint32_t magic_options, bool wait_term, unsigned int respawn_delay)
{
int status = 0;
@ -527,7 +527,7 @@ int invoke_remote(int fd, int prog_argc, char **prog_argv, char *prog_name,
// Invokes the given application
static int invoke(int prog_argc, char **prog_argv, char *prog_name,
enum APP_TYPE app_type, int magic_options, bool wait_term, unsigned int respawn_delay)
enum APP_TYPE app_type, uint32_t magic_options, bool wait_term, unsigned int respawn_delay)
{
int status = 0;
@ -556,7 +556,7 @@ int main(int argc, char *argv[])
{
enum APP_TYPE app_type = UNKNOWN_APP;
int prog_argc = 0;
int magic_options = 0;
uint32_t magic_options = 0;
bool wait_term = true;
unsigned int delay = DEFAULT_DELAY;
unsigned int respawn_delay = RESPAWN_DELAY;
@ -614,7 +614,7 @@ int main(int argc, char *argv[])
case 'n':
wait_term = false;
magic_options &= (!INVOKER_MSG_MAGIC_OPTION_WAIT);
magic_options &= (~INVOKER_MSG_MAGIC_OPTION_WAIT);
break;
case 'G':

@ -19,6 +19,7 @@
#include "appdata.h"
#include "protocol.h"
#include <stdint.h>
#ifdef HAVE_CREDS
#include <sys/creds.h>
@ -41,7 +42,7 @@ AppData::AppData() :
#endif
{}
void AppData::setOptions(int newOptions)
void AppData::setOptions(uint32_t newOptions)
{
m_options = newOptions;
}

@ -24,6 +24,8 @@
#include <sys/creds.h>
#endif
#include <stdint.h>
#include <string>
using std::string;
@ -46,7 +48,7 @@ public:
~AppData();
//! Set options
void setOptions(int options);
void setOptions(uint32_t options);
//! Return options
int options() const;
@ -136,7 +138,7 @@ private:
AppData(const AppData & r);
AppData & operator= (const AppData & r);
int m_options;
uint32_t m_options;
int m_argc;
const char ** m_argv;
string m_appName;

@ -235,7 +235,7 @@ bool Connection::sendAppExitStatus(int status)
return true;
}
int Connection::receiveMagic()
uint32_t Connection::receiveMagic()
{
uint32_t magic = 0;

@ -88,7 +88,7 @@ private:
/*! \brief Receive and return the magic number.
* \return The magic number received from the invoker.
*/
int receiveMagic();
uint32_t receiveMagic();
/*! \brief Receive and return the application name.
* \return Name string

@ -32,7 +32,7 @@ void SocketManager::initSocket(const string & socketId)
// exist for that id / path.
if (m_socketHash.find(socketId) == m_socketHash.end())
{
Logger::logDebug("SoketManager: Initing socket at '%s'..", socketId.c_str());
Logger::logDebug("SocketManager: Initing socket at '%s'..", socketId.c_str());
// Create a new local socket
int socketFd = socket(PF_UNIX, SOCK_STREAM, 0);
@ -43,7 +43,8 @@ void SocketManager::initSocket(const string & socketId)
// try to remove a different file than is passed to sun.sa_data.
// Remove the previous socket file
unlink(socketId.c_str());
if (unlink(socketId.c_str()))
Logger::logError("SocketManager: Failed to unlink existing socket file '%s'", socketId.c_str());
// Initialize the socket struct
struct sockaddr sun;

Loading…
Cancel
Save