#include <sys/param.h>
#include "gcc-compat.h"
-#include "string.h"
+#include "str.h"
#include "log.h"
#include "gcc-compat.h"
-#include "error.h"
+#include "err.h"
#include "ipc.h"
#if (defined(__GNUC__) && defined(__i386__))
{
int ret, semid, key = get_key_or_die(config_file);
+ if (pid)
+ *pid = 0;
ret = mutex_get(key, 0);
if (ret < 0)
return ret;
ret = semctl(semid, 1, GETPID);
if (ret < 0)
return -E_NOT_RUNNING;
- *pid = ret;
+ if (pid)
+ *pid = ret;
ret = mutex_try_lock(semid);
if (ret >= 0)
return -E_NOT_RUNNING;