aboutsummaryrefslogtreecommitdiff
path: root/src/fs/test_fs_start_stop.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
committerChristian Grothoff <christian@grothoff.org>2011-08-15 21:54:06 +0000
commit5746309cb4be2073d550ad7a6885e918631dbc38 (patch)
tree89455bc4aadf977816b38df13f990372cd81d71a /src/fs/test_fs_start_stop.c
parent6fd3e715cae09fa6e657c96f1c6f9711ee51f42f (diff)
downloadgnunet-5746309cb4be2073d550ad7a6885e918631dbc38.tar.gz
gnunet-5746309cb4be2073d550ad7a6885e918631dbc38.zip
indentation
Diffstat (limited to 'src/fs/test_fs_start_stop.c')
-rw-r--r--src/fs/test_fs_start_stop.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/src/fs/test_fs_start_stop.c b/src/fs/test_fs_start_stop.c
index e38a4b965..c65ad2fc1 100644
--- a/src/fs/test_fs_start_stop.c
+++ b/src/fs/test_fs_start_stop.c
@@ -56,12 +56,13 @@ setup_peer (struct PeerContext *p, const char *cfgname)
56{ 56{
57 p->cfg = GNUNET_CONFIGURATION_create (); 57 p->cfg = GNUNET_CONFIGURATION_create ();
58#if START_ARM 58#if START_ARM
59 p->arm_proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm", 59 p->arm_proc =
60 "gnunet-service-arm", 60 GNUNET_OS_start_process (NULL, NULL, "gnunet-service-arm",
61 "gnunet-service-arm",
61#if VERBOSE 62#if VERBOSE
62 "-L", "DEBUG", 63 "-L", "DEBUG",
63#endif 64#endif
64 "-c", cfgname, NULL); 65 "-c", cfgname, NULL);
65#endif 66#endif
66 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname)); 67 GNUNET_assert (GNUNET_OK == GNUNET_CONFIGURATION_load (p->cfg, cfgname));
67} 68}
@@ -77,8 +78,7 @@ stop_arm (struct PeerContext *p)
77 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 78 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
78 if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK) 79 if (GNUNET_OS_process_wait (p->arm_proc) != GNUNET_OK)
79 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid"); 80 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "waitpid");
80 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 81 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "ARM process %u stopped\n",
81 "ARM process %u stopped\n",
82 GNUNET_OS_process_get_pid (p->arm_proc)); 82 GNUNET_OS_process_get_pid (p->arm_proc));
83 GNUNET_OS_process_close (p->arm_proc); 83 GNUNET_OS_process_close (p->arm_proc);
84 p->arm_proc = NULL; 84 p->arm_proc = NULL;
@@ -89,17 +89,14 @@ stop_arm (struct PeerContext *p)
89 89
90 90
91static void 91static void
92run (void *cls, 92run (void *cls, char *const *args, const char *cfgfile,
93 char *const *args, 93 const struct GNUNET_CONFIGURATION_Handle *cfg)
94 const char *cfgfile, const struct GNUNET_CONFIGURATION_Handle *cfg)
95{ 94{
96 struct GNUNET_FS_Handle *fs; 95 struct GNUNET_FS_Handle *fs;
97 96
98 setup_peer (&p1, "test_fs_data.conf"); 97 setup_peer (&p1, "test_fs_data.conf");
99 fs = GNUNET_FS_start (cfg, 98 fs = GNUNET_FS_start (cfg, "test-fs-start-stop", &progress_cb, NULL,
100 "test-fs-start-stop", 99 GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
101 &progress_cb,
102 NULL, GNUNET_FS_FLAGS_NONE, GNUNET_FS_OPTIONS_END);
103 GNUNET_assert (NULL != fs); 100 GNUNET_assert (NULL != fs);
104 GNUNET_FS_stop (fs); 101 GNUNET_FS_stop (fs);
105} 102}
@@ -128,9 +125,8 @@ main (int argc, char *argv[])
128 "WARNING", 125 "WARNING",
129#endif 126#endif
130 NULL); 127 NULL);
131 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, 128 GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx,
132 argvx, "test-fs-start-stop", 129 "test-fs-start-stop", "nohelp", options, &run, NULL);
133 "nohelp", options, &run, NULL);
134 stop_arm (&p1); 130 stop_arm (&p1);
135 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs/"); 131 GNUNET_DISK_directory_remove ("/tmp/gnunet-test-fs/");
136 return 0; 132 return 0;