aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2009-09-07 11:58:04 +0000
committerChristian Grothoff <christian@grothoff.org>2009-09-07 11:58:04 +0000
commit9dac7b6b7b035d55bdb9731795712ead92e11f76 (patch)
tree8bed4ad4617f95bcdaac75dc43c2b2dd461b3e76 /src/util
parent2a534fc5efadca1b65648efb903c3b4c17ac33ad (diff)
downloadgnunet-9dac7b6b7b035d55bdb9731795712ead92e11f76.tar.gz
gnunet-9dac7b6b7b035d55bdb9731795712ead92e11f76.zip
fixes
Diffstat (limited to 'src/util')
-rw-r--r--src/util/configuration.c2
-rw-r--r--src/util/crypto_hash.c12
-rw-r--r--src/util/crypto_rsa.c5
-rw-r--r--src/util/disk.c1
-rw-r--r--src/util/getopt_helpers.c9
-rw-r--r--src/util/os_installation.c2
-rw-r--r--src/util/os_network.c4
-rw-r--r--src/util/test_crypto_aes_weak.c1
-rw-r--r--src/util/test_os_load.c2
-rw-r--r--src/util/test_scheduler.c13
10 files changed, 18 insertions, 33 deletions
diff --git a/src/util/configuration.c b/src/util/configuration.c
index 0ce672dd9..8c32618e2 100644
--- a/src/util/configuration.c
+++ b/src/util/configuration.c
@@ -807,13 +807,11 @@ GNUNET_CONFIGURATION_remove_value_filename (struct GNUNET_CONFIGURATION_Handle
807 char *end; 807 char *end;
808 char *match; 808 char *match;
809 char old; 809 char old;
810 int ret;
811 810
812 if (GNUNET_OK != 811 if (GNUNET_OK !=
813 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &list)) 812 GNUNET_CONFIGURATION_get_value_string (cfg, section, option, &list))
814 return GNUNET_NO; 813 return GNUNET_NO;
815 match = escape_name (value); 814 match = escape_name (value);
816 ret = 0;
817 pos = list; 815 pos = list;
818 while (1) 816 while (1)
819 { 817 {
diff --git a/src/util/crypto_hash.c b/src/util/crypto_hash.c
index 45e599bcf..bc15113c6 100644
--- a/src/util/crypto_hash.c
+++ b/src/util/crypto_hash.c
@@ -214,10 +214,6 @@ sha512_transform (unsigned long long *state, const unsigned char *input)
214 state[5] += f; 214 state[5] += f;
215 state[6] += g; 215 state[6] += g;
216 state[7] += h; 216 state[7] += h;
217
218 /* erase our data */
219 a = b = c = d = e = f = g = h = t1 = t2 = 0;
220 memset (W, 0, 80 * sizeof (unsigned long long));
221} 217}
222 218
223static void 219static void
@@ -281,13 +277,13 @@ sha512_final (struct sha512_ctx *sctx, unsigned char *hash)
281 static unsigned char padding[128] = { 0x80, }; 277 static unsigned char padding[128] = { 0x80, };
282 278
283 unsigned int t; 279 unsigned int t;
284 unsigned long long t2;
285 unsigned char bits[128]; 280 unsigned char bits[128];
286 unsigned int index, pad_len; 281 unsigned int index;
282 unsigned int pad_len;
283 unsigned long long t2;
287 int i, j; 284 int i, j;
288 285
289 index = pad_len = t = i = j = 0; 286 t = i = j = 0;
290 t2 = 0;
291 287
292 /* Save number of bits */ 288 /* Save number of bits */
293 t = sctx->count[0]; 289 t = sctx->count[0];
diff --git a/src/util/crypto_rsa.c b/src/util/crypto_rsa.c
index f686c0359..edf1b2bdf 100644
--- a/src/util/crypto_rsa.c
+++ b/src/util/crypto_rsa.c
@@ -602,7 +602,7 @@ GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename)
602 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 602 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
603 _ 603 _
604 ("Could not aquire lock on file `%s' due to process %u: %s...\n"), 604 ("Could not aquire lock on file `%s' due to process %u: %s...\n"),
605 filename, fl.l_pid, STRERROR (errno)); 605 filename, fl.l_pid, STRERROR (ec));
606 } 606 }
607 memset (&fl, 0, sizeof (struct flock)); 607 memset (&fl, 0, sizeof (struct flock));
608 fl.l_type = F_WRLCK; 608 fl.l_type = F_WRLCK;
@@ -624,7 +624,6 @@ GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename)
624 fl.l_type = F_UNLCK; 624 fl.l_type = F_UNLCK;
625 fl.l_whence = SEEK_SET; 625 fl.l_whence = SEEK_SET;
626 fl.l_len = sizeof (struct RsaPrivateKeyBinaryEncoded); 626 fl.l_len = sizeof (struct RsaPrivateKeyBinaryEncoded);
627 cnt = 0;
628 if (0 != fcntl (fd, F_SETLK, &fl)) 627 if (0 != fcntl (fd, F_SETLK, &fl))
629 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING, 628 GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_WARNING,
630 "fcntl", filename); 629 "fcntl", filename);
@@ -659,7 +658,7 @@ GNUNET_CRYPTO_rsa_key_create_from_file (const char *filename)
659 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 658 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
660 _ 659 _
661 ("Could not aquire lock on file `%s' due to process %u: %s...\n"), 660 ("Could not aquire lock on file `%s' due to process %u: %s...\n"),
662 filename, fl.l_pid, STRERROR (errno)); 661 filename, fl.l_pid, STRERROR (ec));
663 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 662 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
664 _ 663 _
665 ("This may be ok if someone is currently generating a hostkey.\n")); 664 ("This may be ok if someone is currently generating a hostkey.\n"));
diff --git a/src/util/disk.c b/src/util/disk.c
index 3f46923f7..f6a4e7b90 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1038,7 +1038,6 @@ GNUNET_DISK_file_open (const char *fn, int flags, ...)
1038 1038
1039#ifndef MINGW 1039#ifndef MINGW
1040 mode = 0; 1040 mode = 0;
1041 oflags = 0;
1042 if (GNUNET_DISK_OPEN_READWRITE == (flags & GNUNET_DISK_OPEN_READWRITE)) 1041 if (GNUNET_DISK_OPEN_READWRITE == (flags & GNUNET_DISK_OPEN_READWRITE))
1043 oflags = O_RDWR; /* note: O_RDWR is NOT always O_RDONLY | O_WRONLY */ 1042 oflags = O_RDWR; /* note: O_RDWR is NOT always O_RDONLY | O_WRONLY */
1044 else if (flags & GNUNET_DISK_OPEN_READ) 1043 else if (flags & GNUNET_DISK_OPEN_READ)
diff --git a/src/util/getopt_helpers.c b/src/util/getopt_helpers.c
index 3aea5d102..a8a800a00 100644
--- a/src/util/getopt_helpers.c
+++ b/src/util/getopt_helpers.c
@@ -50,11 +50,11 @@ GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
50 const char *value) 50 const char *value)
51{ 51{
52 const char *about = scls; 52 const char *about = scls;
53 int slen; 53 size_t slen;
54 int i; 54 unsigned int i;
55 int j; 55 int j;
56 int ml; 56 size_t ml;
57 int p; 57 size_t p;
58 char *scp; 58 char *scp;
59 const char *trans; 59 const char *trans;
60 const struct GNUNET_GETOPT_CommandLineOption *opt; 60 const struct GNUNET_GETOPT_CommandLineOption *opt;
@@ -62,7 +62,6 @@ GNUNET_GETOPT_format_help_ (struct GNUNET_GETOPT_CommandLineProcessorContext
62 printf ("%s\n%s\n", ctx->binaryOptions, gettext (about)); 62 printf ("%s\n%s\n", ctx->binaryOptions, gettext (about));
63 printf (_ 63 printf (_
64 ("Arguments mandatory for long options are also mandatory for short options.\n")); 64 ("Arguments mandatory for long options are also mandatory for short options.\n"));
65 slen = 0;
66 i = 0; 65 i = 0;
67 opt = ctx->allOptions; 66 opt = ctx->allOptions;
68 while (opt[i].description != NULL) 67 while (opt[i].description != NULL)
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index cc1d61c20..39b5174e3 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -213,14 +213,12 @@ get_path_from_PATH ()
213 char *end; 213 char *end;
214 char *buf; 214 char *buf;
215 const char *p; 215 const char *p;
216 size_t size;
217 216
218 p = getenv ("PATH"); 217 p = getenv ("PATH");
219 if (p == NULL) 218 if (p == NULL)
220 return NULL; 219 return NULL;
221 path = GNUNET_strdup (p); /* because we write on it */ 220 path = GNUNET_strdup (p); /* because we write on it */
222 buf = GNUNET_malloc (strlen (path) + 20); 221 buf = GNUNET_malloc (strlen (path) + 20);
223 size = strlen (path);
224 pos = path; 222 pos = path;
225 223
226 while (NULL != (end = strchr (pos, ':'))) 224 while (NULL != (end = strchr (pos, ':')))
diff --git a/src/util/os_network.c b/src/util/os_network.c
index 4268772df..c872350c5 100644
--- a/src/util/os_network.c
+++ b/src/util/os_network.c
@@ -163,13 +163,11 @@ GNUNET_OS_network_interfaces_list (GNUNET_OS_NetworkInterfaceProcessor proc,
163#elif HAVE_GETIFADDRS && HAVE_FREEIFADDRS 163#elif HAVE_GETIFADDRS && HAVE_FREEIFADDRS
164 164
165 struct ifaddrs *ifa_first; 165 struct ifaddrs *ifa_first;
166 struct ifaddrs *ifa_ptr;
166 socklen_t alen; 167 socklen_t alen;
167 168
168 if (getifaddrs (&ifa_first) == 0) 169 if (getifaddrs (&ifa_first) == 0)
169 { 170 {
170 struct ifaddrs *ifa_ptr;
171
172 ifa_ptr = ifa_first;
173 for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next) 171 for (ifa_ptr = ifa_first; ifa_ptr != NULL; ifa_ptr = ifa_ptr->ifa_next)
174 { 172 {
175 if (ifa_ptr->ifa_name != NULL && 173 if (ifa_ptr->ifa_name != NULL &&
diff --git a/src/util/test_crypto_aes_weak.c b/src/util/test_crypto_aes_weak.c
index 2ce553a21..a694b6481 100644
--- a/src/util/test_crypto_aes_weak.c
+++ b/src/util/test_crypto_aes_weak.c
@@ -145,7 +145,6 @@ getWeakKeys ()
145 { 145 {
146 printf ("testweakkey: gcry_cipher_open failed on trial %d. %s\n", 146 printf ("testweakkey: gcry_cipher_open failed on trial %d. %s\n",
147 number_of_runs, gcry_strerror (rc)); 147 number_of_runs, gcry_strerror (rc));
148 rc = 0;
149 continue; 148 continue;
150 } 149 }
151 150
diff --git a/src/util/test_os_load.c b/src/util/test_os_load.c
index b46a3eb59..7165e7ef2 100644
--- a/src/util/test_os_load.c
+++ b/src/util/test_os_load.c
@@ -165,7 +165,7 @@ testdisk ()
165 } 165 }
166 fprintf (stderr, "\n"); 166 fprintf (stderr, "\n");
167 GNUNET_CONFIGURATION_destroy (cfg); 167 GNUNET_CONFIGURATION_destroy (cfg);
168 return 0; 168 return ret;
169} 169}
170 170
171int 171int
diff --git a/src/util/test_scheduler.c b/src/util/test_scheduler.c
index 0d5af1c0c..811389953 100644
--- a/src/util/test_scheduler.c
+++ b/src/util/test_scheduler.c
@@ -138,7 +138,6 @@ task1 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
138{ 138{
139 int *ok = cls; 139 int *ok = cls;
140 GNUNET_SCHEDULER_TaskIdentifier t2; 140 GNUNET_SCHEDULER_TaskIdentifier t2;
141 GNUNET_SCHEDULER_TaskIdentifier t3;
142 GNUNET_SCHEDULER_TaskIdentifier t4; 141 GNUNET_SCHEDULER_TaskIdentifier t4;
143 142
144 GNUNET_assert (1 == *ok); 143 GNUNET_assert (1 == *ok);
@@ -154,12 +153,12 @@ task1 (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
154 GNUNET_NO, 153 GNUNET_NO,
155 GNUNET_SCHEDULER_PRIORITY_IDLE, 154 GNUNET_SCHEDULER_PRIORITY_IDLE,
156 t2, &task4, cls); 155 t2, &task4, cls);
157 t3 = GNUNET_SCHEDULER_add_delayed (tc->sched, 156 GNUNET_SCHEDULER_add_delayed (tc->sched,
158 GNUNET_NO, 157 GNUNET_NO,
159 GNUNET_SCHEDULER_PRIORITY_DEFAULT, 158 GNUNET_SCHEDULER_PRIORITY_DEFAULT,
160 t2, 159 t2,
161 GNUNET_TIME_relative_get_zero (), 160 GNUNET_TIME_relative_get_zero (),
162 &task3, cls); 161 &task3, cls);
163 /* t4 will go first: lower prio, but prereq! */ 162 /* t4 will go first: lower prio, but prereq! */
164 GNUNET_SCHEDULER_add_after (tc->sched, 163 GNUNET_SCHEDULER_add_after (tc->sched,
165 GNUNET_NO, 164 GNUNET_NO,