Extract process-management functionality into a new lib/process

Note that procmon does *not* go here, since procmon needs to
integrate with the event loop.
This commit is contained in:
Nick Mathewson
2018-06-28 10:53:34 -04:00
parent ec4eee6356
commit 315e6b59dd
34 changed files with 2487 additions and 2230 deletions
+1
View File
@@ -9,6 +9,7 @@
#include "lib/err/torerr.h"
#include "lib/log/torlog.h"
#include "test/test.h"
#include "lib/process/subprocess.h"
static void
dummy_cb_fn(int severity, uint32_t domain, const char *msg)
+2 -1
View File
@@ -8,6 +8,7 @@
#define UTIL_PRIVATE
#define STATEFILE_PRIVATE
#define CONTROL_PRIVATE
#define SUBPROCESS_PRIVATE
#include "or/or.h"
#include "or/config.h"
#include "or/confparse.h"
@@ -17,6 +18,7 @@
#include "common/util.h"
#include "or/statefile.h"
#include "test/test.h"
#include "lib/process/subprocess.h"
static void
reset_mp(managed_proxy_t *mp)
@@ -544,4 +546,3 @@ struct testcase_t pt_tests[] = {
NULL, NULL },
END_OF_TESTCASES
};
+1 -1
View File
@@ -2,6 +2,7 @@
/* See LICENSE for licensing information */
#include "or/or.h"
#include "lib/process/setuid.h"
#ifdef HAVE_SYS_CAPABILITY_H
#include <sys/capability.h>
@@ -189,4 +190,3 @@ main(int argc, char **argv)
return (okay ? 0 : 1);
#endif /* defined(_WIN32) */
}
+5 -1
View File
@@ -10,6 +10,7 @@
#define UTIL_PRIVATE
#define UTIL_MALLOC_PRIVATE
#define SOCKET_PRIVATE
#define SUBPROCESS_PRIVATE
#include "or/or.h"
#include "common/buffers.h"
#include "or/config.h"
@@ -17,10 +18,13 @@
#include "lib/crypt_ops/crypto_rand.h"
#include "test/test.h"
#include "lib/memarea/memarea.h"
#include "common/util_process.h"
#include "lib/process/waitpid.h"
#include "test/log_test_helpers.h"
#include "lib/compress/compress_zstd.h"
#include "lib/fdio/fdio.h"
#include "lib/process/env.h"
#include "lib/process/pidfile.h"
#include "lib/process/subprocess.h"
#ifdef HAVE_PWD_H
#include <pwd.h>
+1 -1
View File
@@ -7,7 +7,7 @@
#include "test/test.h"
#include "common/util_process.h"
#include "lib/process/waitpid.h"
#include "test/log_test_helpers.h"
+3 -2
View File
@@ -5,10 +5,12 @@
#include "orconfig.h"
#define UTIL_PRIVATE
#define SUBPROCESS_PRIVATE
#include "common/util.h"
#include "common/util_process.h"
#include "lib/process/waitpid.h"
#include "lib/crypt_ops/crypto.h"
#include "lib/log/torlog.h"
#include "lib/process/subprocess.h"
#include "test/test.h"
#ifndef BUILDDIR
@@ -388,4 +390,3 @@ struct testcase_t slow_util_tests[] = {
UTIL_TEST(spawn_background_waitpid_notify, 0),
END_OF_TESTCASES
};