[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-anastasis] branch master updated: fixed compilation errors
From: |
gnunet |
Subject: |
[taler-anastasis] branch master updated: fixed compilation errors |
Date: |
Tue, 08 Dec 2020 16:19:00 +0100 |
This is an automated email from the git hooks/post-receive script.
ds-meister pushed a commit to branch master
in repository anastasis.
The following commit(s) were added to refs/heads/master by this push:
new 1767549 fixed compilation errors
1767549 is described below
commit 176754942661694d4e75be410444da9be3a2af7d
Author: Dominik Meister <dominik.meister@hotmail.ch>
AuthorDate: Tue Dec 8 16:18:51 2020 +0100
fixed compilation errors
---
src/include/anastasis_util_lib.h | 35 +++++++++++++++++++++++++++
src/util/child_management.c | 51 +++++++++++++++++++++++++++++++++++++---
2 files changed, 83 insertions(+), 3 deletions(-)
diff --git a/src/include/anastasis_util_lib.h b/src/include/anastasis_util_lib.h
index 9b21f0b..dc2bf74 100644
--- a/src/include/anastasis_util_lib.h
+++ b/src/include/anastasis_util_lib.h
@@ -31,4 +31,39 @@
const struct GNUNET_OS_ProjectData *
ANASTASIS_project_data_default (void);
+
+/**
+ * Handle for the child management
+ */
+struct ANASTASIS_ChildWaitHandle;
+
+/**
+ * Defines a ANASTASIS_ChildCompletedCallback which is sent back
+ * upon death or complettion of a child process. Used to trigger
+ * authentication commands.
+ *
+ * @param cls handle for the callback
+ * @param type type of the process
+ * @param exit_code status code of the process
+ *
+*/
+typedef void
+(*ANASTASIS_ChildCompletedCallback)(void *cls,
+ enum GNUNET_OS_ProcessStatusType type,
+ long unsigned int exit_code);
+/**
+ * Starts the handling of the child processes.
+ * Function checks the status of the child process and sends back a
+ * ANASTASIS_ChildCompletedCallback upon completion/death of the child.
+ *
+ * @param proc child process which is monitored
+ * @param cb reference to the callback which is called after completion
+ * @param cb_cls closure for the callback
+ * @return ANASTASIS_ChildWaitHandle is returned
+ */
+struct ANASTASIS_ChildWaitHandle *
+ANASTASIS_wait_child (struct GNUNET_OS_Process *proc,
+ ANASTASIS_ChildCompletedCallback cb,
+ void *cb_cls);
+
#endif
diff --git a/src/util/child_management.c b/src/util/child_management.c
index 1c98002..092d197 100644
--- a/src/util/child_management.c
+++ b/src/util/child_management.c
@@ -1,9 +1,54 @@
+/*
+ This file is part of Anastasis
+ Copyright (C) 2020 Taler Systems SA
+
+ Anastasis is free software; you can redistribute it and/or modify it under
the
+ terms of the GNU Lesser General Public License as published by the Free
Software
+ Foundation; either version 3, or (at your option) any later version.
+
+ Anastasis is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
+ A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License along with
+ Anastasis; see the file COPYING.GPL. If not, see
<http://www.gnu.org/licenses/>
+*/
+/**
+ * @file lib/child_management.c
+ * @brief anastasis child management
+ * @author Christian Grothoff
+ * @author Dominik Meister
+ */
+
+#include "platform.h"
+#include "anastasis_util_lib.h"
+#include <gnunet/gnunet_util_lib.h>
+
+
+/**
+ * Struct which defines a Child Wait handle
+ */
struct ANASTASIS_ChildWaitHandle
{
+ /**
+ * Linked list to the next child
+ */
struct ANASTASIS_ChildWaitHandle *next;
+ /**
+ * Linked list to the previous child
+ */
struct ANASTASIS_ChildWaitHandle *prev;
+ /**
+ * Child process which is managed
+ */
struct GNUNET_OS_Process *proc;
+ /**
+ * Callback which is called upon completion/death of the child task
+ */
ANASTASIS_ChildCompletedCallback cb;
+ /**
+ * Closure for the handle
+ */
void *cb_cls;
};
@@ -36,7 +81,7 @@ maint_child_death (void *cls)
(void) cls;
sig_task = NULL;
/* drain pipe */
- pr = GNUNET_DISK_pipe_handle (shutdown_pipe_handle,
+ pr = GNUNET_DISK_pipe_handle (sigpipe,
GNUNET_DISK_PIPE_END_READ);
GNUNET_assert (! GNUNET_DISK_handle_invalid (pr));
@@ -47,7 +92,7 @@ maint_child_death (void *cls)
/* find applicable processes that exited */
for (struct ANASTASIS_ChildWaitHandle *cwh = cwh_head;
NULL != cwh;
- cwh = next)
+ cwh = cwh->next)
{
enum GNUNET_OS_ProcessStatusType type;
long unsigned int exit_code = 0;
@@ -100,7 +145,7 @@ sighandler_child_death (void)
}
-static int
+void
child_management_start (void)
{
if (NULL != sigpipe)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-anastasis] branch master updated: fixed compilation errors,
gnunet <=