const struct GNUNET_SCHEDULER_TaskContext *tc)
{
struct RequestContext *pos = cls;
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
char *binary;
char *config;
char *loprefix;
* @param ... more arguments, NULL terminated
* @return PID of the started process, -1 on error
*/
-static GNUNET_OS_Process *
+static struct GNUNET_OS_Process *
do_start_process (const int *lsocks,
const char *first_arg, ...)
{
char *pos;
char *cp;
const char *last;
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
argv_size = 1;
va_start (ap, first_arg);
/**
* Process structure pointer of the child.
*/
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
/**
* Last time the config of this service was
sl->name);
else
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- _("Starting service `%s' (PID: %d)\n"),
- sl->name,
- (int) GNUNET_OS_process_get_pid (sl->proc));
+ _("Starting service `%s'\n"),
+ sl->name);
GNUNET_free (loprefix);
GNUNET_free (options);
- /* FIXME: should check sl->proc */
}
if (pos->proc != NULL)
{
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Stopping service `%s' (PID: %d)\n",
- pos->name,
- GNUNET_OS_process_get_pid (pos->proc));
+ "Stopping service `%s'\n",
+ pos->name);
if (0 != GNUNET_OS_process_kill (pos->proc, SIGTERM))
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
}
struct GNUNET_MessageHeader *hello;
int connect_status;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
struct GNUNET_MessageHeader *hello;
int connect_status;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
struct GNUNET_CORE_Handle *ch;
struct GNUNET_PeerIdentity id;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
static int
check ()
{
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
char cfg_name[128];
char *const argv[] = {
"perf-datastore-api",
{
char cfg_name[128];
#if START_DATASTORE
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
#endif
char *const argv[] = {
"test-datastore-api",
static int
check ()
{
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
char cfg_name[128];
char *const argv[] = {
"test-datastore-api-management",
struct GNUNET_DHT_FindPeerHandle *find_peer_handle;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
main (int argc, char *argv[])
{
#if START_DAEMON
- GNUNET_OS_Process *daemon;
+ struct GNUNET_OS_Process *daemon;
#endif
int ok;
struct GNUNET_ECRS_URI *uri;
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
main (int argc, char *argv[])
{
#if START_DAEMON
- GNUNET_OS_Process *daemon;
+ struct GNUNET_OS_Process *daemon;
#endif
int ok;
char *fn = NULL;
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
struct GNUNET_CONFIGURATION_Handle *cfg;
struct GNUNET_PeerIdentity id;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
struct GNUNET_CONFIGURATION_Handle *cfg;
struct GNUNET_PeerIdentity id;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
main (int argc, char *argv[])
{
#if START_DAEMON
- GNUNET_OS_Process *daemon;
+ struct GNUNET_OS_Process *daemon;
#endif
int ok;
char *fn = NULL;
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
{
struct GNUNET_CONFIGURATION_Handle *cfg;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
struct GNUNET_TRANSPORT_Handle *th;
struct GNUNET_MessageHeader *hello;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
struct GNUNET_CORE_Handle *core;
struct GNUNET_STATISTICS_Handle *stats;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
/**
* Process information (OS-dependent)
*/
-typedef struct _GNUNET_OS_Process GNUNET_OS_Process;
+struct GNUNET_OS_Process;
/**
#define GNUNET_OS_get_hostname_max_length() 255
#endif
-/**
- * Allocates new process structure
- *
- * Should be made internal?
- *
- * @return pointer to allocated structure
- */
-GNUNET_OS_Process *GNUNET_OS_process_alloc ();
-
/**
* Get process structure for current process
*
* @return pointer to the process sturcutre for this process
*/
-GNUNET_OS_Process *GNUNET_OS_process_current ();
+struct GNUNET_OS_Process *GNUNET_OS_process_current (void);
/**
* @param sig signal
* @return 0 on success, -1 on error
*/
-int GNUNET_OS_process_kill (GNUNET_OS_Process *proc, int sig);
-
-/**
- * Get process ID
- *
- * Should be made internal?
- *
- * @param proc pointer to process structure
- * @return process ID
- */
-pid_t GNUNET_OS_process_get_pid (GNUNET_OS_Process *proc);
-
-/**
- * Set process ID
- *
- * Should be made internal?
- *
- * @param proc pointer to process structure
- * @param pid process ID
- */
-void GNUNET_OS_process_set_pid (GNUNET_OS_Process *proc, pid_t pid);
+int GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig);
-#if WINDOWS
-/**
- * Get process handle
- *
- * Should be made internal?
- *
- * @param proc pointer to process structure
- * @return process handle
- */
-HANDLE GNUNET_OS_process_get_handle (GNUNET_OS_Process *proc);
-
-/**
- * Set process handle
- *
- * Should be made internal?
- *
- * @param proc pointer to process structure
- * @param handle process handle
- */
-void GNUNET_OS_process_set_handle(GNUNET_OS_Process *proc, HANDLE handle);
-#endif
/**
* Cleans up process structure contents (OS-dependent) and deallocates it
*
* @param proc pointer to process structure
*/
-void GNUNET_OS_process_close (GNUNET_OS_Process *proc);
+void GNUNET_OS_process_close (struct GNUNET_OS_Process *proc);
+
/**
* Set process priority
* @param prio priority value
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
-int GNUNET_OS_set_process_priority (GNUNET_OS_Process *proc,
+int GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc,
enum GNUNET_SCHEDULER_Priority prio);
* @param ... NULL-terminated list of arguments to the process
* @return pointer to process structure of the new process, NULL on error
*/
-GNUNET_OS_Process *
+struct GNUNET_OS_Process *
GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin,
struct GNUNET_DISK_PipeHandle *pipe_stdout,
const char *filename, ...);
* including the process name as the first argument
* @return pointer to process structure of the new process, NULL on error
*/
-GNUNET_OS_Process *
+struct GNUNET_OS_Process *
GNUNET_OS_start_process_v (const int *lsocks, const char *filename,
char *const argv[]);
* @param code return code/signal number
* @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise
*/
-int GNUNET_OS_process_status (GNUNET_OS_Process *proc,
- enum GNUNET_OS_ProcessStatusType *type, unsigned long *code);
+int GNUNET_OS_process_status (struct GNUNET_OS_Process *proc,
+ enum GNUNET_OS_ProcessStatusType *type, unsigned long *code);
/**
* @param proc pointer to process structure of the process to wait for
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
-int GNUNET_OS_process_wait (GNUNET_OS_Process *proc);
+int GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc);
#if 0 /* keep Emacsens' auto-indent happy */
/**
* PID of the process that we started last.
*/
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
/**
* In which phase are we during the start of
NULL
};
#if START_SERVICE
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
struct GNUNET_GETOPT_CommandLineOption options[] = {
GNUNET_GETOPT_OPTION_END
};
check ()
{
int ok = 3;
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
char *const argv[] = { "test-peerinfo-api",
"-c",
"test_peerinfo_api_data.conf",
GNUNET_GETOPT_OPTION_END
};
#if START_SERVICE
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
"gnunet-service-statistics",
#if DEBUG_STATISTICS
GNUNET_GETOPT_OPTION_END
};
#if START_SERVICE
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-statistics",
"gnunet-service-statistics",
#if DEBUG_STATISTICS
{
char *peer_number;
char *connect_number;
- GNUNET_OS_Process *mem_process;
+ struct GNUNET_OS_Process *mem_process;
GNUNET_asprintf(&peer_number, "%llu", num_peers);
GNUNET_asprintf(&connect_number, "%llu", expected_connections);
mem_process = GNUNET_OS_start_process (NULL, NULL, "./memsize.pl",
FILE *temp_friend_handle;
unsigned int pg_iter;
char *temp_service_path;
- GNUNET_OS_Process **procarr;
+ struct GNUNET_OS_Process **procarr;
char *arg;
char * mytemp;
enum GNUNET_OS_ProcessStatusType type;
int ret;
int max_wait = 10;
- procarr = GNUNET_malloc(sizeof(GNUNET_OS_Process *) * pg->total);
+ procarr = GNUNET_malloc(sizeof(struct GNUNET_OS_Process *) * pg->total);
for (pg_iter = 0; pg_iter < pg->total; pg_iter++)
{
mytemp = GNUNET_DISK_mktemp("friends");
static struct BlacklistContext blacklist_ctx;
unsigned int pg_iter;
char *temp_service_path;
- GNUNET_OS_Process **procarr;
+ struct GNUNET_OS_Process **procarr;
char *arg;
char *mytemp;
enum GNUNET_OS_ProcessStatusType type;
char *pos;
char *temp_transports;
- procarr = GNUNET_malloc(sizeof(GNUNET_OS_Process *) * pg->total);
+ procarr = GNUNET_malloc(sizeof(struct GNUNET_OS_Process *) * pg->total);
for (pg_iter = 0; pg_iter < pg->total; pg_iter++)
{
mytemp = GNUNET_DISK_mktemp("blacklist");
/**
* The process id of the server process (if behind NAT)
*/
- GNUNET_OS_Process *server_proc;
+ struct GNUNET_OS_Process *server_proc;
/**
* List of open TCP sessions.
char inet4[INET_ADDRSTRLEN];
char *address_as_string;
char *port_as_string;
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
const struct sockaddr *sa = (const struct sockaddr *)addr;
#if DEBUG_TCP_NAT
/**
* The process id of the server process (if behind NAT)
*/
- GNUNET_OS_Process *server_proc;
+ struct GNUNET_OS_Process *server_proc;
};
char addr_buf[INET_ADDRSTRLEN];
char *address_as_string;
char *port_as_string;
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
const struct IPv4UdpAddress *t4;
GNUNET_assert(addrlen == sizeof(struct IPv4UdpAddress));
/**
* The process id of the server process (if behind NAT)
*/
- GNUNET_OS_Process *server_proc;
+ struct GNUNET_OS_Process *server_proc;
/**
* The interface of the wlan card given to us by the user.
struct GNUNET_TRANSPORT_Handle *th;
struct GNUNET_PeerIdentity id;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
struct GNUNET_TRANSPORT_Handle *th;
struct GNUNET_PeerIdentity id;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
struct GNUNET_TRANSPORT_Handle *th;
struct GNUNET_PeerIdentity id;
#if START_ARM
- GNUNET_OS_Process *arm_proc;
+ struct GNUNET_OS_Process *arm_proc;
#endif
};
* Process ID of the "find" process that we use for
* entropy gathering.
*/
-static GNUNET_OS_Process *genproc;
+static struct GNUNET_OS_Process *genproc;
/**
* Function called by libgcrypt whenever we are
#include "gnunet_os_lib.h"
#include "disk.h"
-struct _GNUNET_OS_Process
+struct GNUNET_OS_Process
{
pid_t pid;
#if WINDOWS
#endif
};
-static GNUNET_OS_Process current_process;
+static struct GNUNET_OS_Process current_process;
+
-GNUNET_OS_Process *
-GNUNET_OS_process_alloc ()
-{
- GNUNET_OS_Process *ret = GNUNET_malloc (sizeof (GNUNET_OS_Process));
- ret->pid = 0;
#if WINDOWS
- ret->handle = NULL;
-#endif
- return ret;
+void
+GNUNET_OS_process_set_handle(struct GNUNET_OS_Process *proc, HANDLE handle)
+{
+ if (proc->handle != NULL)
+ CloseHandle (proc->handle);
+ proc->handle = handle;
}
+#endif
+
/**
* Get process structure for current process
*
* @return pointer to the process sturcutre for this process
*/
-GNUNET_OS_Process *
+struct GNUNET_OS_Process *
GNUNET_OS_process_current ()
{
#if WINDOWS
}
int
-GNUNET_OS_process_kill (GNUNET_OS_Process *proc, int sig)
+GNUNET_OS_process_kill (struct GNUNET_OS_Process *proc, int sig)
{
#if WINDOWS
if (sig == SIGKILL || sig == SIGTERM)
HANDLE h = GNUNET_OS_process_get_handle (proc);
if (NULL == h)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Invalid process information {%d, %08X}\n", GNUNET_OS_process_get_pid (proc), h);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ _("Invalid process information {%d, %08X}\n"),
+ proc->pid,
+ h);
return -1;
}
if (!TerminateProcess (h, 0))
errno = EINVAL;
return -1;
#else
- return kill (GNUNET_OS_process_get_pid (proc), sig);
+ return kill (proc->pid, sig);
#endif
}
-pid_t
-GNUNET_OS_process_get_pid (GNUNET_OS_Process *proc)
-{
- return proc->pid;
-}
-
-void
-GNUNET_OS_process_set_pid (GNUNET_OS_Process *proc, pid_t pid)
-{
- proc->pid = pid;
-}
-
-#if WINDOWS
-HANDLE
-GNUNET_OS_process_get_handle (GNUNET_OS_Process *proc)
-{
- return proc->handle;
-}
-
-void
-GNUNET_OS_process_set_handle(GNUNET_OS_Process *proc, HANDLE handle)
-{
- if (proc->handle != NULL)
- CloseHandle (proc->handle);
- proc->handle = handle;
-}
-#endif
void
-GNUNET_OS_process_close (GNUNET_OS_Process *proc)
+GNUNET_OS_process_close (struct GNUNET_OS_Process *proc)
{
#if WINDOWS
if (proc->handle != NULL)
static DWORD WINAPI
ChildWaitThread (void *arg)
{
- GNUNET_OS_Process *proc = (GNUNET_OS_Process *) arg;
+ struct GNUNET_OS_Process *proc = (struct GNUNET_OS_Process *) arg;
WaitForSingleObject (proc->handle, INFINITE);
if (w32_sigchld_handler)
* @return GNUNET_OK on success, GNUNET_SYSERR on error
*/
int
-GNUNET_OS_set_process_priority (GNUNET_OS_Process *proc,
+GNUNET_OS_set_process_priority (struct GNUNET_OS_Process *proc,
enum GNUNET_SCHEDULER_Priority prio)
{
int rprio;
- pid_t pid;
GNUNET_assert (prio < GNUNET_SCHEDULER_PRIORITY_COUNT);
if (prio == GNUNET_SCHEDULER_PRIORITY_KEEP)
return GNUNET_SYSERR;
}
- pid = GNUNET_OS_process_get_pid (proc);
-
/* Set process priority */
#ifdef MINGW
{
- HANDLE h = GNUNET_OS_process_get_handle (proc);
+ HANDLE h = proc->handle;
GNUNET_assert (h != NULL);
SetPriorityClass (h, rprio);
}
#elif LINUX
+ pid_t pid;
+
+ pid = proc->pid;
if ( (0 == pid) ||
(pid == getpid () ) )
{
else
{
if (0 != setpriority (PRIO_PROCESS, pid, rprio))
-
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING |
GNUNET_ERROR_TYPE_BULK, "setpriority");
* @param ... NULL-terminated list of arguments to the process
* @return pointer to process structure of the new process, NULL on error
*/
-GNUNET_OS_Process *
+struct GNUNET_OS_Process *
GNUNET_OS_start_process (struct GNUNET_DISK_PipeHandle *pipe_stdin,
struct GNUNET_DISK_PipeHandle *pipe_stdout,
const char *filename, ...)
#ifndef MINGW
pid_t ret;
- GNUNET_OS_Process *gnunet_proc = NULL;
+ struct GNUNET_OS_Process *gnunet_proc = NULL;
char **argv;
int argc;
int fd_stdout_write;
GNUNET_DISK_pipe_close_end(pipe_stdin, GNUNET_DISK_PIPE_END_READ);
sleep (1);
#endif
- gnunet_proc = GNUNET_OS_process_alloc ();
- GNUNET_OS_process_set_pid (gnunet_proc, ret);
+ gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process));
+ gnunet_proc->pid = ret;
}
GNUNET_free (argv);
return gnunet_proc;
int findresult;
STARTUPINFO start;
PROCESS_INFORMATION proc;
- GNUNET_OS_Process *gnunet_proc = NULL;
+ struct GNUNET_OS_Process *gnunet_proc = NULL;
HANDLE stdin_handle;
HANDLE stdout_handle;
return NULL;
}
- gnunet_proc = GNUNET_OS_process_alloc ();
- GNUNET_OS_process_set_pid (gnunet_proc, proc.dwProcessId);
- GNUNET_OS_process_set_handle (gnunet_proc, proc.hProcess);
+ gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process));
+ gnunet_proc->pid = proc.dwProcessId;
+ gnunet_proc->handle = proc.hProcess;
CreateThread (NULL, 64000, ChildWaitThread, (void *) gnunet_proc, 0, NULL);
* @param argv NULL-terminated list of arguments to the process
* @return process ID of the new process, -1 on error
*/
-GNUNET_OS_Process *
+struct GNUNET_OS_Process *
GNUNET_OS_start_process_v (const int *lsocks,
const char *filename, char *const argv[])
{
pid_t ret;
char lpid[16];
char fds[16];
- GNUNET_OS_Process *gnunet_proc = NULL;
+ struct GNUNET_OS_Process *gnunet_proc = NULL;
int i;
int j;
int k;
be plenty in practice */
sleep (1);
#endif
- gnunet_proc = GNUNET_OS_process_alloc ();
- GNUNET_OS_process_set_pid (gnunet_proc, ret);
+ gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process));
+ gnunet_proc->pid = ret;
}
GNUNET_array_grow (lscp, ls, 0);
return gnunet_proc;
int argcount = 0;
char *non_const_filename = NULL;
int filenamelen = 0;
- GNUNET_OS_Process *gnunet_proc = NULL;
+ struct GNUNET_OS_Process *gnunet_proc = NULL;
GNUNET_assert (lsocks == NULL);
/* Count the number of arguments */
return NULL;
}
- gnunet_proc = GNUNET_OS_process_alloc ();
- GNUNET_OS_process_set_pid (gnunet_proc, proc.dwProcessId);
- GNUNET_OS_process_set_handle (gnunet_proc, proc.hProcess);
+ gnunet_proc = GNUNET_malloc (sizeof (struct GNUNET_OS_Process));
+ gnunet_proc->pid = proc.dwProcessId;
+ gnunet_proc->handle = proc.hProcess;
CreateThread (NULL, 64000, ChildWaitThread, (void *) gnunet_proc, 0, NULL);
* @return GNUNET_OK on success, GNUNET_NO if the process is still running, GNUNET_SYSERR otherwise
*/
int
-GNUNET_OS_process_status (GNUNET_OS_Process *proc, enum GNUNET_OS_ProcessStatusType *type,
+GNUNET_OS_process_status (struct GNUNET_OS_Process *proc,
+ enum GNUNET_OS_ProcessStatusType *type,
unsigned long *code)
{
#ifndef MINGW
int ret;
GNUNET_assert (0 != proc);
- ret = waitpid (GNUNET_OS_process_get_pid (proc), &status, WNOHANG);
+ ret = waitpid (proc->pid, &status, WNOHANG);
if (ret < 0)
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
*code = 0;
return GNUNET_NO;
}
- if (GNUNET_OS_process_get_pid (proc) != ret)
+ if (proc->pid != ret)
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
return GNUNET_SYSERR;
DWORD c, error_code, ret;
h = GNUNET_OS_process_get_handle (proc);
- ret = GNUNET_OS_process_get_pid (proc);
+ ret = proc->pid;
if (h == NULL || ret == 0)
{
GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Invalid process information {%d, %08X}\n", ret, h);
* @return GNUNET_OK on success, GNUNET_SYSERR otherwise
*/
int
-GNUNET_OS_process_wait (GNUNET_OS_Process *proc)
+GNUNET_OS_process_wait (struct GNUNET_OS_Process *proc)
{
- pid_t pid = GNUNET_OS_process_get_pid (proc);
+
#ifndef MINGW
+ pid_t pid = proc->pid;
if (pid != waitpid (pid, NULL, 0))
return GNUNET_SYSERR;
-
return GNUNET_OK;
#else
HANDLE h;
int ret;
- h = GNUNET_OS_process_get_handle (proc);
+ h = proc->handle;
if (NULL == h)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Invalid process information {%d, %08X}\n", pid, h);
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ "Invalid process information {%d, %08X}\n",
+ proc->pid,
+ h);
return GNUNET_SYSERR;
}
if (h == NULL)
static char *test_phrase = "HELLO WORLD";
static int ok;
-static GNUNET_OS_Process *proc;
+static struct GNUNET_OS_Process *proc;
/* Pipe to write to started processes stdin (on write end) */
static struct GNUNET_DISK_PipeHandle *hello_pipe_stdin;
/* Pipe to read from started processes stdout (on read end) */
int ok = 1 + 2 + 4 + 8;
char *fn;
char *pfx;
- GNUNET_OS_Process *proc;
+ struct GNUNET_OS_Process *proc;
char * const argv[] =
{ "test-resolver-api", "-c", "test_resolver_api_data.conf",
#if VERBOSE
/**
* The process id of the helper
*/
-static GNUNET_OS_Process *helper_proc;
+static struct GNUNET_OS_Process *helper_proc;
/**
* a list of outgoing dns-query-packets