diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-12-21 16:12:30 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-12-21 16:12:30 +0000 |
commit | e4878c10e87477ff23d64dfca0dac39a6619ba5c (patch) | |
tree | 09caf4e00e35f2d86722ed835b462822768c6c24 /src/peerinfo | |
parent | 7cd7199155b6313c9e1a4c10dc2efe21cacfd823 (diff) | |
download | gnunet-e4878c10e87477ff23d64dfca0dac39a6619ba5c.tar.gz gnunet-e4878c10e87477ff23d64dfca0dac39a6619ba5c.zip |
fixes
Diffstat (limited to 'src/peerinfo')
-rw-r--r-- | src/peerinfo/gnunet-service-peerinfo.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/src/peerinfo/gnunet-service-peerinfo.c b/src/peerinfo/gnunet-service-peerinfo.c index 31b0199f4..6031c99af 100644 --- a/src/peerinfo/gnunet-service-peerinfo.c +++ b/src/peerinfo/gnunet-service-peerinfo.c | |||
@@ -304,7 +304,12 @@ cron_scan_directory_data_hosts (void *cls, | |||
304 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) | 304 | if (0 != (tc->reason & GNUNET_SCHEDULER_REASON_SHUTDOWN)) |
305 | return; | 305 | return; |
306 | count = 0; | 306 | count = 0; |
307 | GNUNET_DISK_directory_create (networkIdDirectory); | 307 | if (GNUNET_SYSERR == GNUNET_DISK_directory_create (networkIdDirectory)) |
308 | { | ||
309 | GNUNET_SCHEDULER_add_delayed (DATA_HOST_FREQ, | ||
310 | &cron_scan_directory_data_hosts, NULL); | ||
311 | return; | ||
312 | } | ||
308 | GNUNET_DISK_directory_scan (networkIdDirectory, | 313 | GNUNET_DISK_directory_scan (networkIdDirectory, |
309 | &hosts_directory_scan_callback, &count); | 314 | &hosts_directory_scan_callback, &count); |
310 | if ((0 == count) && (0 == (++retries & 31))) | 315 | if ((0 == count) && (0 == (++retries & 31))) |
@@ -355,12 +360,19 @@ bind_address (const struct GNUNET_PeerIdentity *peer, | |||
355 | host->hello = mrg; | 360 | host->hello = mrg; |
356 | } | 361 | } |
357 | fn = get_host_filename (peer); | 362 | fn = get_host_filename (peer); |
358 | GNUNET_DISK_directory_create_for_file (fn); | 363 | if (GNUNET_OK == GNUNET_DISK_directory_create_for_file (fn)) |
359 | GNUNET_DISK_fn_write (fn, | 364 | { |
360 | host->hello, | 365 | if (GNUNET_OK != |
361 | GNUNET_HELLO_size (host->hello), | 366 | GNUNET_DISK_fn_write (fn, |
362 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE | 367 | host->hello, |
363 | | GNUNET_DISK_PERM_GROUP_READ | GNUNET_DISK_PERM_OTHER_READ); | 368 | GNUNET_HELLO_size (host->hello), |
369 | GNUNET_DISK_PERM_USER_READ | GNUNET_DISK_PERM_USER_WRITE | ||
370 | | GNUNET_DISK_PERM_GROUP_READ | GNUNET_DISK_PERM_OTHER_READ)) | ||
371 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, | ||
372 | "write", | ||
373 | fn); | ||
374 | |||
375 | } | ||
364 | GNUNET_free (fn); | 376 | GNUNET_free (fn); |
365 | notify_all (host); | 377 | notify_all (host); |
366 | } | 378 | } |