aboutsummaryrefslogtreecommitdiff
path: root/src/peerinfo
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-11-03 21:26:40 +0000
committerChristian Grothoff <christian@grothoff.org>2010-11-03 21:26:40 +0000
commit721e49caeea6ba5073f8bc5c6c08359295c02bb5 (patch)
treee06e80ba90af91e9452a48a7a5782913199b4877 /src/peerinfo
parent37ac1b7c9e9e05f93d4100cfb53450ec2d370989 (diff)
downloadgnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.tar.gz
gnunet-721e49caeea6ba5073f8bc5c6c08359295c02bb5.zip
original patch from Mantis 1614
Diffstat (limited to 'src/peerinfo')
-rwxr-xr-xsrc/peerinfo/perf_peerinfo_api.c11
-rw-r--r--src/peerinfo/test_peerinfo_api.c10
2 files changed, 13 insertions, 8 deletions
diff --git a/src/peerinfo/perf_peerinfo_api.c b/src/peerinfo/perf_peerinfo_api.c
index ea21b0fae..eea2eb973 100755
--- a/src/peerinfo/perf_peerinfo_api.c
+++ b/src/peerinfo/perf_peerinfo_api.c
@@ -166,11 +166,11 @@ check ()
166 NULL 166 NULL
167 }; 167 };
168#if START_SERVICE 168#if START_SERVICE
169 pid_t pid; 169 GNUNET_OS_Process *proc;
170 struct GNUNET_GETOPT_CommandLineOption options[] = { 170 struct GNUNET_GETOPT_CommandLineOption options[] = {
171 GNUNET_GETOPT_OPTION_END 171 GNUNET_GETOPT_OPTION_END
172 }; 172 };
173 pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-peerinfo", 173 proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-peerinfo",
174 "gnunet-service-peerinfo", 174 "gnunet-service-peerinfo",
175#if DEBUG_PEERINFO 175#if DEBUG_PEERINFO
176 "-L", "DEBUG", 176 "-L", "DEBUG",
@@ -185,12 +185,15 @@ check ()
185 numpeers, 185 numpeers,
186 NUM_REQUESTS * NUM_REQUESTS / 2); 186 NUM_REQUESTS * NUM_REQUESTS / 2);
187#if START_SERVICE 187#if START_SERVICE
188 if (0 != PLIBC_KILL (pid, SIGTERM)) 188 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
189 { 189 {
190 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 190 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
191 ok = 1; 191 ok = 1;
192 } 192 }
193 GNUNET_OS_process_wait(pid); 193 GNUNET_OS_process_wait (proc);
194 GNUNET_OS_process_close (proc);
195 proc = NULL;
196
194#endif 197#endif
195 return ok; 198 return ok;
196} 199}
diff --git a/src/peerinfo/test_peerinfo_api.c b/src/peerinfo/test_peerinfo_api.c
index 34655c893..b2e95d767 100644
--- a/src/peerinfo/test_peerinfo_api.c
+++ b/src/peerinfo/test_peerinfo_api.c
@@ -165,7 +165,7 @@ static int
165check () 165check ()
166{ 166{
167 int ok = 3; 167 int ok = 3;
168 pid_t pid; 168 GNUNET_OS_Process *proc;
169 char *const argv[] = { "test-peerinfo-api", 169 char *const argv[] = { "test-peerinfo-api",
170 "-c", 170 "-c",
171 "test_peerinfo_api_data.conf", 171 "test_peerinfo_api_data.conf",
@@ -177,7 +177,7 @@ check ()
177 struct GNUNET_GETOPT_CommandLineOption options[] = { 177 struct GNUNET_GETOPT_CommandLineOption options[] = {
178 GNUNET_GETOPT_OPTION_END 178 GNUNET_GETOPT_OPTION_END
179 }; 179 };
180 pid = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-peerinfo", 180 proc = GNUNET_OS_start_process (NULL, NULL, "gnunet-service-peerinfo",
181 "gnunet-service-peerinfo", 181 "gnunet-service-peerinfo",
182#if DEBUG_PEERINFO 182#if DEBUG_PEERINFO
183 "-L", "DEBUG", 183 "-L", "DEBUG",
@@ -186,12 +186,14 @@ check ()
186 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1, 186 GNUNET_PROGRAM_run ((sizeof (argv) / sizeof (char *)) - 1,
187 argv, "test-peerinfo-api", "nohelp", 187 argv, "test-peerinfo-api", "nohelp",
188 options, &run, &ok); 188 options, &run, &ok);
189 if (0 != PLIBC_KILL (pid, SIGTERM)) 189 if (0 != GNUNET_OS_process_kill (proc, SIGTERM))
190 { 190 {
191 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill"); 191 GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING, "kill");
192 ok = 1; 192 ok = 1;
193 } 193 }
194 GNUNET_OS_process_wait(pid); 194 GNUNET_OS_process_wait (proc);
195 GNUNET_OS_process_close (proc);
196 proc = NULL;
195 return ok; 197 return ok;
196} 198}
197 199