diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-06-18 14:30:23 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-06-18 14:30:23 +0000 |
commit | 0ea8e006d5f5ef84e31e000607bd24a23f8fc1ed (patch) | |
tree | 9b36e245d428fd641512eb1e1ff86b2a83adf2c2 /src | |
parent | 200aaa0dd6813f19eb7ed67a0fdc301d091fc2d7 (diff) | |
download | gnunet-0ea8e006d5f5ef84e31e000607bd24a23f8fc1ed.tar.gz gnunet-0ea8e006d5f5ef84e31e000607bd24a23f8fc1ed.zip |
code clean up
Diffstat (limited to 'src')
-rw-r--r-- | src/arm/gnunet-service-arm_interceptor.c | 4 | ||||
-rw-r--r-- | src/core/gnunet-service-core.c | 4 | ||||
-rw-r--r-- | src/fs/fs_uri.c | 2 | ||||
-rw-r--r-- | src/hostlist/hostlist-server.c | 4 | ||||
-rw-r--r-- | src/util/disk.c | 2 | ||||
-rw-r--r-- | src/util/os_installation.c | 3 | ||||
-rw-r--r-- | src/util/service.c | 3 |
7 files changed, 14 insertions, 8 deletions
diff --git a/src/arm/gnunet-service-arm_interceptor.c b/src/arm/gnunet-service-arm_interceptor.c index afefe4e48..9380a8deb 100644 --- a/src/arm/gnunet-service-arm_interceptor.c +++ b/src/arm/gnunet-service-arm_interceptor.c | |||
@@ -474,14 +474,14 @@ receiveFromService (void *cls, | |||
474 | BUFFER_SIZE); | 474 | BUFFER_SIZE); |
475 | if (fc->service_to_client_bufferDataLength <= 0) | 475 | if (fc->service_to_client_bufferDataLength <= 0) |
476 | { | 476 | { |
477 | #if DEBUG_SERVICE_MANAGER | ||
477 | if (fc->service_to_client_bufferDataLength == 0) | 478 | if (fc->service_to_client_bufferDataLength == 0) |
478 | { | 479 | { |
479 | #if DEBUG_SERVICE_MANAGER | ||
480 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 480 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |
481 | "Service `%s' stopped sending data.\n", | 481 | "Service `%s' stopped sending data.\n", |
482 | fc->listen_info->serviceName); | 482 | fc->listen_info->serviceName); |
483 | #endif | ||
484 | } | 483 | } |
484 | #endif | ||
485 | if (fc->first_write_done != GNUNET_YES) | 485 | if (fc->first_write_done != GNUNET_YES) |
486 | { | 486 | { |
487 | fc->service_to_client_bufferDataLength = 0; | 487 | fc->service_to_client_bufferDataLength = 0; |
diff --git a/src/core/gnunet-service-core.c b/src/core/gnunet-service-core.c index 7a2111e0e..34b3511a8 100644 --- a/src/core/gnunet-service-core.c +++ b/src/core/gnunet-service-core.c | |||
@@ -3205,7 +3205,9 @@ deliver_message (struct Neighbour *sender, | |||
3205 | (unsigned int) type, | 3205 | (unsigned int) type, |
3206 | GNUNET_i2s (&sender->peer)); | 3206 | GNUNET_i2s (&sender->peer)); |
3207 | #endif | 3207 | #endif |
3208 | /* FIXME: stats... */ | 3208 | GNUNET_STATISTICS_update (stats, |
3209 | gettext_noop ("# messages not delivered to any client"), | ||
3210 | 1, GNUNET_NO); | ||
3209 | } | 3211 | } |
3210 | } | 3212 | } |
3211 | 3213 | ||
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 2e1ec92c8..f2c291784 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -1756,7 +1756,7 @@ bin2enc (const void *data, size_t size) | |||
1756 | } | 1756 | } |
1757 | } | 1757 | } |
1758 | if (hbits > 0) | 1758 | if (hbits > 0) |
1759 | ret[len++] = tbl[bits & 63]; | 1759 | ret[len] = tbl[bits & 63]; |
1760 | return ret; | 1760 | return ret; |
1761 | } | 1761 | } |
1762 | 1762 | ||
diff --git a/src/hostlist/hostlist-server.c b/src/hostlist/hostlist-server.c index 8d4d38d09..5d8a07ef2 100644 --- a/src/hostlist/hostlist-server.c +++ b/src/hostlist/hostlist-server.c | |||
@@ -62,12 +62,12 @@ static struct GNUNET_STATISTICS_Handle *stats; | |||
62 | /** | 62 | /** |
63 | * Handle to the core service (NULL until we've connected to it). | 63 | * Handle to the core service (NULL until we've connected to it). |
64 | */ | 64 | */ |
65 | struct GNUNET_CORE_Handle *core; | 65 | static struct GNUNET_CORE_Handle *core; |
66 | 66 | ||
67 | /** | 67 | /** |
68 | * Handle to the peerinfo notify service (NULL until we've connected to it). | 68 | * Handle to the peerinfo notify service (NULL until we've connected to it). |
69 | */ | 69 | */ |
70 | struct GNUNET_PEERINFO_NotifyContext *notify; | 70 | static struct GNUNET_PEERINFO_NotifyContext *notify; |
71 | 71 | ||
72 | /** | 72 | /** |
73 | * Our primary task for IPv4. | 73 | * Our primary task for IPv4. |
diff --git a/src/util/disk.c b/src/util/disk.c index bcede53e4..94615f198 100644 --- a/src/util/disk.c +++ b/src/util/disk.c | |||
@@ -704,6 +704,8 @@ GNUNET_DISK_directory_scan (const char *dirName, | |||
704 | 704 | ||
705 | GNUNET_assert (dirName != NULL); | 705 | GNUNET_assert (dirName != NULL); |
706 | dname = GNUNET_STRINGS_filename_expand (dirName); | 706 | dname = GNUNET_STRINGS_filename_expand (dirName); |
707 | if (dname == NULL) | ||
708 | return GNUNET_SYSERR; | ||
707 | while ((strlen (dname) > 0) && (dname[strlen (dname) - 1] == DIR_SEPARATOR)) | 709 | while ((strlen (dname) > 0) && (dname[strlen (dname) - 1] == DIR_SEPARATOR)) |
708 | dname[strlen (dname) - 1] = '\0'; | 710 | dname[strlen (dname) - 1] = '\0'; |
709 | if (0 != STAT (dname, &istat)) | 711 | if (0 != STAT (dname, &istat)) |
diff --git a/src/util/os_installation.c b/src/util/os_installation.c index c61028187..19469e81e 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c | |||
@@ -96,11 +96,12 @@ get_path_from_proc_exe () | |||
96 | GNUNET_snprintf (fn, | 96 | GNUNET_snprintf (fn, |
97 | sizeof(fn), "/proc/%u/exe", getpid ()); | 97 | sizeof(fn), "/proc/%u/exe", getpid ()); |
98 | size = readlink (fn, lnk, sizeof (lnk)-1); | 98 | size = readlink (fn, lnk, sizeof (lnk)-1); |
99 | if ((size == 0) || (size >= sizeof(lnk)-1)) | 99 | if (size <= 0) |
100 | { | 100 | { |
101 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "readlink", fn); | 101 | GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "readlink", fn); |
102 | return NULL; | 102 | return NULL; |
103 | } | 103 | } |
104 | GNUNET_assert (size < sizeof (lnk)); | ||
104 | lnk[size] = '\0'; | 105 | lnk[size] = '\0'; |
105 | while ((lnk[size] != '/') && (size > 0)) | 106 | while ((lnk[size] != '/') && (size > 0)) |
106 | size--; | 107 | size--; |
diff --git a/src/util/service.c b/src/util/service.c index a4316768d..cd27380ee 100644 --- a/src/util/service.c +++ b/src/util/service.c | |||
@@ -732,10 +732,11 @@ add_unixpath (struct sockaddr **saddrs, | |||
732 | unixpath, | 732 | unixpath, |
733 | slen); | 733 | slen); |
734 | un->sun_path[slen] = '\0'; | 734 | un->sun_path[slen] = '\0'; |
735 | slen += sizeof (sa_family_t); | ||
736 | #if LINUX | 735 | #if LINUX |
737 | un->sun_path[0] = '\0'; | 736 | un->sun_path[0] = '\0'; |
738 | slen = sizeof (struct sockaddr_un); | 737 | slen = sizeof (struct sockaddr_un); |
738 | #else | ||
739 | slen += sizeof (sa_family_t); | ||
739 | #endif | 740 | #endif |
740 | *saddrs = (struct sockaddr*) un; | 741 | *saddrs = (struct sockaddr*) un; |
741 | *saddrlens = slen; | 742 | *saddrlens = slen; |