[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r4026 - in GNUnet/src: applications/datastore applications/
From: |
grothoff |
Subject: |
[GNUnet-SVN] r4026 - in GNUnet/src: applications/datastore applications/fragmentation applications/identity server transports util/os |
Date: |
Sat, 23 Dec 2006 13:52:57 -0800 (PST) |
Author: grothoff
Date: 2006-12-23 13:52:51 -0800 (Sat, 23 Dec 2006)
New Revision: 4026
Modified:
GNUnet/src/applications/datastore/prefetch.c
GNUnet/src/applications/fragmentation/fragmentation.c
GNUnet/src/applications/identity/identity.c
GNUnet/src/server/handler.c
GNUnet/src/transports/http.c
GNUnet/src/transports/tcp_old.c
GNUnet/src/util/os/semaphore.c
Log:
Hi,
some more patchwork:
- document os_set_fd_limit better
- fix misspelled "aquire"'s
- fix a semaphore bug
The semaphore bug hit me when I tried running "make check" on OS X. Some
fsui tests just stalled at FSUI_start/IPC_SEMAPHORE_DOWN. Then I found
out that OS X actually has a semaphore name limit of about 32 chars,
and, because of that the semaphore names were halved in
IPC_SEMAPHORE_CREATE. I suppose some semaphores were mapped to same
names and hence when they already existed (with zero value) while
opening they couldn't be "DOWN"ed. Being that semaphore names are
created by catenating the name with the gnunet home path, I figured it's
better to use the second half of the name rather than the first, because
using the first will always yield the same name for names of the same
length.
-- hl
Modified: GNUnet/src/applications/datastore/prefetch.c
===================================================================
--- GNUnet/src/applications/datastore/prefetch.c 2006-12-23 12:39:05 UTC
(rev 4025)
+++ GNUnet/src/applications/datastore/prefetch.c 2006-12-23 21:52:51 UTC
(rev 4026)
@@ -90,7 +90,7 @@
static struct GC_Configuration * cfg;
-static int aquire(const HashCode512 * key,
+static int acquire(const HashCode512 * key,
const Datastore_Value * value,
void * closure) {
int load;
@@ -156,7 +156,7 @@
static void * rcbAcquire(void * unused) {
int load;
while (doneSignal == NO) {
- sq->iterateMigrationOrder(&aquire,
+ sq->iterateMigrationOrder(&acquire,
NULL);
/* sleep here, too - otherwise we start looping immediately
if there is no content in the DB! */
Modified: GNUnet/src/applications/fragmentation/fragmentation.c
===================================================================
--- GNUnet/src/applications/fragmentation/fragmentation.c 2006-12-23
12:39:05 UTC (rev 4025)
+++ GNUnet/src/applications/fragmentation/fragmentation.c 2006-12-23
21:52:51 UTC (rev 4026)
@@ -233,7 +233,7 @@
* See if the new fragment is a part of this entry and join them if
* yes. Return SYSERR if the fragments do not match. Return OK if
* the fragments do match and the fragment has been processed. The
- * defragCacheLock is already aquired by the caller whenever this
+ * defragCacheLock is already acquired by the caller whenever this
* method is called.<p>
*
* @param entry the entry in the cache
Modified: GNUnet/src/applications/identity/identity.c
===================================================================
--- GNUnet/src/applications/identity/identity.c 2006-12-23 12:39:05 UTC (rev
4025)
+++ GNUnet/src/applications/identity/identity.c 2006-12-23 21:52:51 UTC (rev
4026)
@@ -950,7 +950,7 @@
data);
MUTEX_LOCK(lock_);
/* we gave up the lock,
- need to re-aquire entry (if possible)! */
+ need to re-acquire entry (if possible)! */
if (i >= numberOfHosts_)
break;
entry = hosts_[i];
Modified: GNUnet/src/server/handler.c
===================================================================
--- GNUnet/src/server/handler.c 2006-12-23 12:39:05 UTC (rev 4025)
+++ GNUnet/src/server/handler.c 2006-12-23 21:52:51 UTC (rev 4026)
@@ -557,7 +557,7 @@
FREE(mp);
return;
}
- /* aquire buffer */
+ /* acquire buffer */
if (SYSERR == transport->associate(mp->tsession))
mp->tsession = NULL;
Modified: GNUnet/src/transports/http.c
===================================================================
--- GNUnet/src/transports/http.c 2006-12-23 12:39:05 UTC (rev 4025)
+++ GNUnet/src/transports/http.c 2006-12-23 21:52:51 UTC (rev 4026)
@@ -326,7 +326,7 @@
/**
* Disconnect from a remote node. May only be called
- * on sessions that were aquired by the caller first.
+ * on sessions that were acquired by the caller first.
* For the core, aquiration means to call associate or
* connect. The number of disconnects must match the
* number of calls to connect+associate.
Modified: GNUnet/src/transports/tcp_old.c
===================================================================
--- GNUnet/src/transports/tcp_old.c 2006-12-23 12:39:05 UTC (rev 4025)
+++ GNUnet/src/transports/tcp_old.c 2006-12-23 21:52:51 UTC (rev 4026)
@@ -250,7 +250,7 @@
/**
* Disconnect from a remote node. May only be called
- * on sessions that were aquired by the caller first.
+ * on sessions that were acquired by the caller first.
* For the core, aquiration means to call associate or
* connect. The number of disconnects must match the
* number of calls to connect+associate.
Modified: GNUnet/src/util/os/semaphore.c
===================================================================
--- GNUnet/src/util/os/semaphore.c 2006-12-23 12:39:05 UTC (rev 4025)
+++ GNUnet/src/util/os/semaphore.c 2006-12-23 21:52:51 UTC (rev 4026)
@@ -168,10 +168,14 @@
initialValue);
while ( (ret->internal == (void *) SEM_FAILED)
&& (errno == ENAMETOOLONG) ) {
+ char * halfBasename;
+
if (strlen(noslashBasename) < 4)
break; /* definitely OS error... */
- noslashBasename[strlen(noslashBasename)/2] = '\0'; /* cut in half */
- ret->internal = sem_open(noslashBasename,
+ /* FIXME: this might cause unintended mapping to same names */
+ halfBasename = noslashBasename+strlen(noslashBasename)/2; /* cut in half */
+ halfBasename[0] = '/';
+ ret->internal = sem_open(halfBasename,
O_CREAT,
S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP, /* 660 */
initialValue);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r4026 - in GNUnet/src: applications/datastore applications/fragmentation applications/identity server transports util/os,
grothoff <=