[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r5747 - gnunet-fuse
From: |
gnunet |
Subject: |
[GNUnet-SVN] r5747 - gnunet-fuse |
Date: |
Fri, 23 Nov 2007 22:08:02 -0700 (MST) |
Author: grothoff
Date: 2007-11-23 22:08:01 -0700 (Fri, 23 Nov 2007)
New Revision: 5747
Modified:
gnunet-fuse/INSTALL
gnunet-fuse/configure.ac
gnunet-fuse/directory.c
gnunet-fuse/dirent.c
gnunet-fuse/file.c
gnunet-fuse/getattr.c
gnunet-fuse/gnfs.h
gnunet-fuse/main.c
gnunet-fuse/mkdir.c
gnunet-fuse/mknod.c
gnunet-fuse/read.c
gnunet-fuse/readdir.c
gnunet-fuse/rename.c
gnunet-fuse/rmdir.c
gnunet-fuse/special_file.c
gnunet-fuse/unlink.c
gnunet-fuse/utimens.c
gnunet-fuse/write.c
Log:
making fuse work with renamed APIs:
Modified: gnunet-fuse/INSTALL
===================================================================
--- gnunet-fuse/INSTALL 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/INSTALL 2007-11-24 05:08:01 UTC (rev 5747)
@@ -1,19 +1,13 @@
-Installation Instructions
-*************************
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
+Foundation, Inc.
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006 Free Software Foundation, Inc.
-
-This file is free documentation; the Free Software Foundation gives
+ This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
-Briefly, the shell commands `./configure; make; make install' should
-configure, build, and install this package. The following
-more-detailed instructions are generic; see the `README' file for
-instructions specific to this package.
+ These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
@@ -26,9 +20,9 @@
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. Caching is
+the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
-cache files.
+cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
@@ -38,17 +32,20 @@
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You need `configure.ac' if
-you want to change it or regenerate `configure' using a newer version
-of `autoconf'.
+`configure' by a program called `autoconf'. You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system.
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
- Running `configure' might take a while. While running, it prints
- some messages telling which features it is checking for.
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
2. Type `make' to compile the package.
@@ -70,49 +67,51 @@
Compilers and Options
=====================
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about. Run `./configure --help' for
-details on some of the pertinent environment variables.
+ Some systems require unusual options for compilation or linking that
+the `configure' script does not know about. Run `./configure --help'
+for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
- ./configure CC=c99 CFLAGS=-g LIBS=-lposix
+ ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
-You can compile the package for more than one kind of computer at the
+ You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
-own directory. To do this, you can use GNU `make'. `cd' to the
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
- With a non-GNU `make', it is safer to compile the package for one
-architecture at a time in the source code directory. After you have
-installed the package for one architecture, use `make distclean' before
-reconfiguring for another architecture.
+ If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory. After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
Installation Names
==================
-By default, `make install' installs the package's commands under
-`/usr/local/bin', include files under `/usr/local/include', etc. You
-can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
+ By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
-pass the option `--exec-prefix=PREFIX' to `configure', the package uses
-PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files still use the regular prefix.
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
+options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
@@ -123,7 +122,7 @@
Optional Features
=================
-Some packages pay attention to `--enable-FEATURE' options to
+ Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
@@ -138,11 +137,11 @@
Specifying the System Type
==========================
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
+ There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on. Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
@@ -157,7 +156,7 @@
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
-use the option `--target=TYPE' to select the type of system they will
+use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
@@ -168,9 +167,9 @@
Sharing Defaults
================
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
+ If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
@@ -179,7 +178,7 @@
Defining Variables
==================
-Variables not defined in a site shell script can be set in the
+ Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
@@ -187,18 +186,14 @@
./configure CC=/usr/local2/bin/gcc
-causes the specified `gcc' to be used as the C compiler (unless it is
+will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
-Unfortunately, this technique does not work for `CONFIG_SHELL' due to
-an Autoconf bug. Until the bug is fixed you can use this workaround:
-
- CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash
-
`configure' Invocation
======================
-`configure' recognizes the following options to control how it operates.
+ `configure' recognizes the following options to control how it
+operates.
`--help'
`-h'
Modified: gnunet-fuse/configure.ac
===================================================================
--- gnunet-fuse/configure.ac 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/configure.ac 2007-11-24 05:08:01 UTC (rev 5747)
@@ -49,7 +49,7 @@
AC_MSG_ERROR([compiling gnunet-fuse requires GNUnet core headers]
))
-AC_CHECK_LIB(gnunetutil_boot,GNUNET_init,,
+AC_CHECK_LIB(gnunetutil,GNUNET_init,,
AC_MSG_ERROR([gnunet-fuse requires GNUnet-Util]))
AC_CHECK_LIB(gnunetecrs,ECRS_createMetaData,,
AC_MSG_ERROR([gnunet-fuse requires ECRS]))
Modified: gnunet-fuse/directory.c
===================================================================
--- gnunet-fuse/directory.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/directory.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -27,7 +27,7 @@
#include "gnfs.h"
static void dpcb(unsigned long long totalBytes,
- unsigned long long completedBytes, cron_t eta,
+ unsigned long long completedBytes, GNUNET_CronTime eta,
unsigned long long lastBlockOffset, const char *lastBlock,
unsigned int lastBlockSize, void *cls)
{
@@ -41,13 +41,13 @@
{
(void)cls;
if(closing)
- return OK;
+ return GNUNET_OK;
if(fuse_interrupted())
- return SYSERR;
- return OK;
+ return GNUNET_SYSERR;
+ return GNUNET_OK;
}
-static int dir_cache_cb(const ECRS_FileInfo *fi, const HashCode512 *key,
+static int dir_cache_cb(const ECRS_FileInfo *fi, const GNUNET_HashCode *key,
int isRoot, void *data)
{
struct dirent *de, *deparent = data;
@@ -56,8 +56,8 @@
(void)key;
- if(isRoot == YES)
- return OK;
+ if(isRoot == GNUNET_YES)
+ return GNUNET_OK;
/* Figure out the filename and type from metadata */
filename = ECRS_getFromMetaData(fi->meta, EXTRACTOR_FILENAME);
@@ -65,10 +65,10 @@
{
GE_LOG(ectx, GE_BULK | GE_USER | GE_WARNING,
"%s: dirent has no filename\n", __FUNCTION__);
- return OK;
+ return GNUNET_OK;
}
len = strlen(filename);
- if(ECRS_isDirectory(fi->meta) == YES)
+ if(ECRS_isDirectory(fi->meta) == GNUNET_YES)
{
if(filename[len - 1] == '/' || filename[len - 1] == '\\')
filename[len - 1] = '\0';
@@ -80,11 +80,11 @@
/* Create newpath, the path to this entry */
path = gn_dirent_path_get(deparent);
rlen = strlen(path);
- newpath = MALLOC(rlen + len + 1);
+ newpath = GNUNET_malloc(rlen + len + 1);
strcpy(newpath, path);
if(path[rlen - 1] != G_DIR_SEPARATOR)
strcat(newpath, G_DIR_SEPARATOR_S);
- FREE(path);
+ GNUNET_free(path);
strcat(newpath, filename);
/* Create a new dirent for this entry only if one doesn't already exist
@@ -102,16 +102,16 @@
}
/* Add it to the directory's list (steals our ref)*/
- MUTEX_LOCK(de->de_path_mutex);
+ GNUNET_mutex_lock(de->de_path_mutex);
GE_ASSERT(ectx,
!g_hash_table_lookup(deparent->de_dir_hash, de->de_basename));
g_hash_table_replace(deparent->de_dir_hash, de->de_basename, de);
- MUTEX_UNLOCK(de->de_path_mutex);
+ GNUNET_mutex_unlock(de->de_path_mutex);
/* Clean up */
- FREE(filename);
- FREE(newpath);
- return OK;
+ GNUNET_free(filename);
+ GNUNET_free(newpath);
+ return GNUNET_OK;
}
static int directory_cache_locked(struct dirent *de)
@@ -122,22 +122,22 @@
guint64 len;
len = ECRS_fileSize(de->de_fi.uri);
- mem = MALLOC(len);
+ mem = GNUNET_malloc(len);
ret = ECRS_downloadPartialFile(ectx, cfg, de->de_fi.uri,
- "/dev/null", 0, len, anonymity, YES, dpcb, mem, tt,
+ "/dev/null", 0, len, anonymity, GNUNET_YES, dpcb, mem, tt,
NULL);
- if(ret != OK)
+ if(ret != GNUNET_OK)
{
GE_LOG(ectx, GE_BULK | GE_USER | GE_ERROR,
"%s: failed to download directory\n",
__FUNCTION__);
- FREE(mem);
+ GNUNET_free(mem);
return -1;
}
de->de_dir_hash = g_hash_table_new_full(g_str_hash, g_str_equal, NULL,
(GDestroyNotify)gn_dirent_put);
ECRS_listDirectory(ectx, mem, len, &md, dir_cache_cb, de);
- FREE(mem);
+ GNUNET_free(mem);
ECRS_freeMetaData(md);
de->de_cached = 1;
GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG,
@@ -173,7 +173,7 @@
if(de->de_type != DE_DIR)
return -1;
- if(SEMAPHORE_DOWN(de->de_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(de->de_sema, GNUNET_YES) == GNUNET_SYSERR)
return -1;
if(!de->de_cached)
{
@@ -185,7 +185,7 @@
d.data = data;
g_hash_table_find(de->de_dir_hash, dir_foreach_callback, &d);
out:
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
return ret;
}
@@ -198,7 +198,7 @@
if(de->de_type != DE_DIR)
return NULL;
- if(SEMAPHORE_DOWN(de->de_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(de->de_sema, GNUNET_YES) == GNUNET_SYSERR)
return NULL;
if(!de->de_cached)
{
@@ -209,7 +209,7 @@
if(ret != NULL)
gn_dirent_ref(ret);
out:
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
return ret;
}
@@ -233,10 +233,10 @@
}
/* If we're already in there, bail out */
- MUTEX_LOCK(dechild->de_path_mutex);
+ GNUNET_mutex_lock(dechild->de_path_mutex);
if(g_hash_table_lookup(de->de_dir_hash, dechild->de_basename))
{
- MUTEX_UNLOCK(dechild->de_path_mutex);
+ GNUNET_mutex_unlock(dechild->de_path_mutex);
gn_unlock_path(de, GN_UNLOCK_CLEAN);
return -1;
}
@@ -244,7 +244,7 @@
/* Insert the child in our de_dir_hash */
gn_dirent_ref(dechild);
g_hash_table_replace(de->de_dir_hash, dechild->de_basename, dechild);
- MUTEX_UNLOCK(dechild->de_path_mutex);
+ GNUNET_mutex_unlock(dechild->de_path_mutex);
/* Cache the dirent */
gn_dirent_cache_insert(dechild);
@@ -273,16 +273,16 @@
}
/* Remove from dir_hash */
- MUTEX_LOCK(dechild->de_path_mutex);
+ GNUNET_mutex_lock(dechild->de_path_mutex);
if(!g_hash_table_remove(de->de_dir_hash, dechild->de_basename))
{
- MUTEX_UNLOCK(dechild->de_path_mutex);
+ GNUNET_mutex_unlock(dechild->de_path_mutex);
GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR,
"%s: not found in dir_hash\n",
__FUNCTION__);
goto out_err;
}
- MUTEX_UNLOCK(dechild->de_path_mutex);
+ GNUNET_mutex_unlock(dechild->de_path_mutex);
/* Remove from dirent cache */
gn_dirent_cache_remove(dechild);
@@ -295,7 +295,7 @@
return -1;
}
-static void upcb(guint64 totalBytes, guint64 completedBytes, cron_t eta,
+static void upcb(guint64 totalBytes, guint64 completedBytes, GNUNET_CronTime
eta,
void *closure)
{
(void)totalBytes;
@@ -318,7 +318,7 @@
int ret = 0;
(void)key;
- if(SEMAPHORE_DOWN(de->de_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(de->de_sema, GNUNET_YES) == GNUNET_SYSERR)
{
d->failed = 1;
return 1;
@@ -346,7 +346,7 @@
d->fis[d->count].meta = ECRS_dupMetaData(de->de_fi.meta);
d->count++;
out:
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
return ret;
}
@@ -366,7 +366,7 @@
return 0;
/* Collect FileInfo from hash table and make a GNUnet directory */
- d.fis = MALLOC(g_hash_table_size(de->de_dir_hash) * sizeof(*d.fis));
+ d.fis = GNUNET_malloc(g_hash_table_size(de->de_dir_hash) *
sizeof(*d.fis));
d.count = 0;
d.failed = 0;
g_hash_table_find(de->de_dir_hash, dir_upload_callback, &d);
@@ -385,8 +385,8 @@
ECRS_freeUri(d.fis[i].uri);
ECRS_freeMetaData(d.fis[i].meta);
}
- FREE(d.fis);
- if(ret == SYSERR)
+ GNUNET_free(d.fis);
+ if(ret == GNUNET_SYSERR)
{
GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR,
"%s: ECRS_createDirectory failed\n",
@@ -406,11 +406,11 @@
GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG,
"%s: wrote to %lld bytes to '%s'\n", __FUNCTION__, len,
filename);
- ret = ECRS_uploadFile(ectx, cfg, filename, NO, anonymity, priority,
+ ret = ECRS_uploadFile(ectx, cfg, filename, GNUNET_NO, anonymity,
priority,
-1, upcb, NULL, tt, NULL, &uri);
close(fd);
unlink(filename);
- if(ret == SYSERR)
+ if(ret == GNUNET_SYSERR)
{
GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR,
"%s: ECRS_uploadFile failed\n", __FUNCTION__);
Modified: gnunet-fuse/dirent.c
===================================================================
--- gnunet-fuse/dirent.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/dirent.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -25,16 +25,16 @@
#include "gnfs.h"
GHashTable *path_hash;
-struct SEMAPHORE *path_sema;
+struct GNUNET_Semaphore *path_sema;
/*
* Reference a dirent, call gn_dirent_put when finished
*/
void gn_dirent_ref(struct dirent *de)
{
- MUTEX_LOCK(de->de_refs_mutex);
+ GNUNET_mutex_lock(de->de_refs_mutex);
de->de_refs++;
- MUTEX_UNLOCK(de->de_refs_mutex);
+ GNUNET_mutex_unlock(de->de_refs_mutex);
}
/*
@@ -44,12 +44,12 @@
{
struct dirent *de;
- if(SEMAPHORE_DOWN(path_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(path_sema, GNUNET_YES) == GNUNET_SYSERR)
return NULL;
de = g_hash_table_lookup(path_hash, path);
if(de != NULL)
gn_dirent_ref(de);
- SEMAPHORE_UP(path_sema);
+ GNUNET_semaphore_up(path_sema);
return de;
}
@@ -58,18 +58,18 @@
*/
void gn_dirent_put(struct dirent *de)
{
- MUTEX_LOCK(de->de_refs_mutex);
+ GNUNET_mutex_lock(de->de_refs_mutex);
de->de_refs--;
if(de->de_refs >= 1)
{
- MUTEX_UNLOCK(de->de_refs_mutex);
+ GNUNET_mutex_unlock(de->de_refs_mutex);
return;
}
- MUTEX_UNLOCK(de->de_refs_mutex);
- MUTEX_DESTROY(de->de_path_mutex);
- FREE(de->de_path);
- MUTEX_DESTROY(de->de_refs_mutex);
- SEMAPHORE_DESTROY(de->de_sema);
+ GNUNET_mutex_unlock(de->de_refs_mutex);
+ GNUNET_mutex_destroy(de->de_path_mutex);
+ GNUNET_free(de->de_path);
+ GNUNET_mutex_destroy(de->de_refs_mutex);
+ GNUNET_semaphore_destroy(de->de_sema);
if(de->de_fi.uri != NULL)
ECRS_freeUri(de->de_fi.uri);
if(de->de_fi.meta != NULL)
@@ -87,19 +87,19 @@
{
close(de->de_fd);
unlink(de->de_filename);
- FREE(de->de_filename);
+ GNUNET_free(de->de_filename);
}
}
- FREE(de);
+ GNUNET_free(de);
}
char *gn_dirent_path_get(struct dirent *de)
{
char *ret;
- MUTEX_LOCK(de->de_path_mutex);
- ret = STRDUP(de->de_path);
- MUTEX_UNLOCK(de->de_path_mutex);
+ GNUNET_mutex_lock(de->de_path_mutex);
+ ret = GNUNET_strdup(de->de_path);
+ GNUNET_mutex_unlock(de->de_path_mutex);
return ret;
}
@@ -108,18 +108,18 @@
*/
void gn_dirent_path_set(struct dirent *de, const char *path)
{
- MUTEX_LOCK(de->de_path_mutex);
- FREE(de->de_path);
- de->de_path = STRDUP(path);
+ GNUNET_mutex_lock(de->de_path_mutex);
+ GNUNET_free(de->de_path);
+ de->de_path = GNUNET_strdup(path);
de->de_basename = strrchr(de->de_path, G_DIR_SEPARATOR) + 1;
- MUTEX_UNLOCK(de->de_path_mutex);
+ GNUNET_mutex_unlock(de->de_path_mutex);
}
void gn_dirent_cache_init(void)
{
path_hash = g_hash_table_new_full(g_str_hash, g_str_equal, NULL,
(GDestroyNotify)gn_dirent_put);
- path_sema = SEMAPHORE_CREATE(1);
+ path_sema = GNUNET_semaphore_create(1);
}
/*
@@ -130,14 +130,14 @@
{
struct dirent *de;
- de = MALLOC(sizeof(*de));
- de->de_path_mutex = MUTEX_CREATE(0);
- de->de_path = STRDUP(path);
+ de = GNUNET_malloc(sizeof(*de));
+ de->de_path_mutex = GNUNET_mutex_create(0);
+ de->de_path = GNUNET_strdup(path);
de->de_basename = strrchr(de->de_path, G_DIR_SEPARATOR) + 1;
- de->de_refs_mutex = MUTEX_CREATE(0);
+ de->de_refs_mutex = GNUNET_mutex_create(0);
de->de_refs = 1;
de->de_type = type;
- de->de_sema = SEMAPHORE_CREATE(1);
+ de->de_sema = GNUNET_semaphore_create(1);
if(uri != NULL)
{
de->de_dirty = 0;
@@ -153,7 +153,7 @@
char filename[] = GN_MKSTEMP_FILE;
de->de_fd = mkstemp(filename);
- de->de_filename = STRDUP(filename);
+ de->de_filename = GNUNET_strdup(filename);
}
else
{
@@ -177,14 +177,14 @@
/* TODO: Here we need to see if the cache has gotten too big and empty
* it.
* XXX: But what about diry entries?? */
- if(SEMAPHORE_DOWN(path_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(path_sema, GNUNET_YES) == GNUNET_SYSERR)
return;
- MUTEX_LOCK(de->de_path_mutex);
+ GNUNET_mutex_lock(de->de_path_mutex);
GE_ASSERT(ectx, !g_hash_table_lookup(path_hash, de->de_path));
g_hash_table_replace(path_hash, de->de_path, de);
- MUTEX_UNLOCK(de->de_path_mutex);
+ GNUNET_mutex_unlock(de->de_path_mutex);
gn_dirent_ref(de);
- SEMAPHORE_UP(path_sema);
+ GNUNET_semaphore_up(path_sema);
}
/*
@@ -192,13 +192,13 @@
*/
void gn_dirent_cache_remove(struct dirent *de)
{
- if(SEMAPHORE_DOWN(path_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(path_sema, GNUNET_YES) == GNUNET_SYSERR)
return;
/* This is safe because we still hold a ref */
- MUTEX_LOCK(de->de_path_mutex);
+ GNUNET_mutex_lock(de->de_path_mutex);
g_hash_table_remove(path_hash, de->de_path);
- MUTEX_UNLOCK(de->de_path_mutex);
- SEMAPHORE_UP(path_sema);
+ GNUNET_mutex_unlock(de->de_path_mutex);
+ GNUNET_semaphore_up(path_sema);
}
/*
@@ -216,7 +216,7 @@
/* Allocate partial path buffer */
len = strlen(path);
- ppath = MALLOC(len + 1);
+ ppath = GNUNET_malloc(len + 1);
plen = 0;
/* Loop through each path element */
@@ -273,7 +273,7 @@
}
/* Done */
- FREE(ppath);
+ GNUNET_free(ppath);
if(de == NULL)
return -1;
gn_dirent_put(de);
@@ -313,7 +313,7 @@
{
struct dirent **detmp = data;
- if(SEMAPHORE_DOWN(de->de_sema, YES) == -1)
+ if(GNUNET_semaphore_down(de->de_sema, GNUNET_YES) == -1)
return 1;
gn_dirent_ref(de);
*detmp = de;
@@ -331,7 +331,7 @@
path = gn_dirent_path_get(de);
if(gn_path_foreach(path, lock_path_callback, &detmp) == -1)
{
- FREE(path);
+ GNUNET_free(path);
GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR,
"%s: failed!\n", __FUNCTION__);
/* Back out all the locks we aquired */
@@ -339,7 +339,7 @@
gn_unlock_path(detmp, GN_UNLOCK_CLEAN);
return -1;
}
- FREE(path);
+ GNUNET_free(path);
return 0;
}
@@ -357,7 +357,7 @@
de->de_dirty = 1;
else if(d->dirty == GN_UNLOCK_ANCESTORS_DIRTY && de != d->de)
de->de_dirty = 1;
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
gn_dirent_put(de);
return 0;
}
@@ -375,11 +375,11 @@
path = gn_dirent_path_get(de);
if(gn_path_foreach(path, unlock_path_callback, &d) == -1)
{
- FREE(path);
+ GNUNET_free(path);
GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR,
"%s: failed!\n", __FUNCTION__);
return -1;
}
- FREE(path);
+ GNUNET_free(path);
return 0;
}
Modified: gnunet-fuse/file.c
===================================================================
--- gnunet-fuse/file.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/file.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -30,13 +30,13 @@
{
(void)cls;
if(closing)
- return OK;
+ return GNUNET_OK;
if(fuse_interrupted())
- return SYSERR;
- return OK;
+ return GNUNET_SYSERR;
+ return GNUNET_OK;
}
-static void upcb(guint64 totalBytes, guint64 completedBytes, cron_t eta,
+static void upcb(guint64 totalBytes, guint64 completedBytes, GNUNET_CronTime
eta,
void *closure)
{
(void)totalBytes;
@@ -46,7 +46,7 @@
}
static void dpcb(unsigned long long totalBytes,
- unsigned long long completedBytes, cron_t eta,
+ unsigned long long completedBytes, GNUNET_CronTime eta,
unsigned long long lastBlockOffset, const char *lastBlock,
unsigned int lastBlockSize, void *cls)
{
@@ -78,18 +78,18 @@
| GE_ERROR, "mkstemp", filename);
return -1;
}
- de->de_filename = STRDUP(filename);
+ de->de_filename = GNUNET_strdup(filename);
GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_DEBUG,
"%s: downloading '%s'\n", __FUNCTION__, de->de_filename);
if(ECRS_downloadFile(ectx, cfg, de->de_fi.uri, filename, anonymity,
- dpcb, NULL, tt, NULL) == SYSERR)
+ dpcb, NULL, tt, NULL) == GNUNET_SYSERR)
{
GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR,
"%s: download failed\n", __FUNCTION__);
close(de->de_fd);
unlink(de->de_filename);
- FREE(de->de_filename);
+ GNUNET_free(de->de_filename);
return -1;
}
@@ -106,8 +106,8 @@
if(!de->de_dirty)
return 0;
- if(ECRS_uploadFile(ectx, cfg, de->de_filename, NO, anonymity, priority,
- -1, upcb, NULL, tt, NULL, &uri) == SYSERR)
+ if(ECRS_uploadFile(ectx, cfg, de->de_filename, GNUNET_NO, anonymity,
priority,
+ -1, upcb, NULL, tt, NULL, &uri) == GNUNET_SYSERR)
{
GE_LOG(ectx, GE_BULK | GE_DEVELOPER | GE_ERROR,
"%s: upload failed\n", __FUNCTION__);
@@ -120,6 +120,6 @@
de->de_dirty = 0;
close(de->de_fd);
unlink(de->de_filename);
- FREE(de->de_filename);
+ GNUNET_free(de->de_filename);
return 0;
}
Modified: gnunet-fuse/getattr.c
===================================================================
--- gnunet-fuse/getattr.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/getattr.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -53,7 +53,7 @@
}
/* If it's a cached file just call stat */
- if(SEMAPHORE_DOWN(de->de_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(de->de_sema, GNUNET_YES) == GNUNET_SYSERR)
{
gn_dirent_put(de);
return -EIO;
@@ -80,7 +80,7 @@
else
stbuf->st_size = 0;
out:
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
gn_dirent_put(de);
return ret;
}
Modified: gnunet-fuse/gnfs.h
===================================================================
--- gnunet-fuse/gnfs.h 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/gnfs.h 2007-11-24 05:08:01 UTC (rev 5747)
@@ -43,17 +43,17 @@
struct dirent
{
/* de_path_mutex protects de_path and de_basename */
- struct MUTEX *de_path_mutex;
+ struct GNUNET_Mutex *de_path_mutex;
gchar *de_path;
gchar *de_basename;
/* de_refs_mutex protects de_refs */
- struct MUTEX *de_refs_mutex;
+ struct GNUNET_Mutex *de_refs_mutex;
gint de_refs;
gchar de_type;
#define DE_FILE 'f'
#define DE_DIR 'd'
/* de_sema protects everything below */
- struct SEMAPHORE *de_sema;
+ struct GNUNET_Semaphore *de_sema;
/* Cached entries have their entire contents in memory or on disk */
gboolean de_cached;
/* Dirty entires have been changed and not published in GNUnet (implies
Modified: gnunet-fuse/main.c
===================================================================
--- gnunet-fuse/main.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/main.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -25,8 +25,7 @@
#include <glib.h>
#include <fuse.h>
#include <GNUnet/gnunet_directories.h>
-#include <GNUnet/gnunet_util_boot.h>
-#include <GNUnet/gnunet_util_error_loggers.h>
+#include <GNUnet/gnunet_util.h>
#include <GNUnet/gnunet_ecrs_lib.h>
#include "gnfs.h"
#include "gettext.h"
@@ -56,7 +55,7 @@
int root_fd;
struct dirent *root_de;
-int getopt_configure_argv(CommandLineProcessorContext *ctx, void *scls,
+int getopt_configure_argv(GNUNET_CommandLineProcessorContext *ctx, void *scls,
const char *cmdLineOption, const char *value)
{
(void)ctx;
@@ -66,7 +65,7 @@
fuse_argv[fuse_argc] = (char *)value;
fuse_argc++;
fuse_argv[fuse_argc] = NULL;
- return OK;
+ return GNUNET_OK;
}
static struct fuse_operations fops =
@@ -86,24 +85,24 @@
.utimens = gn_utimens,
};
-static struct CommandLineOption gn_options[] =
+static struct GNUNET_CommandLineOption gn_options[] =
{
- COMMAND_LINE_OPTION_HELP("GNUnet filesystem"),
- COMMAND_LINE_OPTION_CFG_FILE(&cfgFilename), /* -c */
- COMMAND_LINE_OPTION_LOGGING, /* -L */
+ GNUNET_COMMAND_LINE_OPTION_HELP("GNUnet filesystem"),
+ GNUNET_COMMAND_LINE_OPTION_CFG_FILE(&cfgFilename), /* -c */
+ GNUNET_COMMAND_LINE_OPTION_LOGGING, /* -L */
{ 'l', "logfile", "FILE", "set logfile name", 1,
- &gnunet_getopt_configure_set_string, &cfgLogfile },
+ &GNUNET_getopt_configure_set_string, &cfgLogfile },
{ 'a', "anonymity", "LEVEL",
"set the desired LEVEL of sender-anonymity", 1,
- &gnunet_getopt_configure_set_uint, &anonymity },
+ &GNUNET_getopt_configure_set_uint, &anonymity },
{ 'p', "priority", "LEVEL",
"set the desired LEVEL of priority", 1,
- &gnunet_getopt_configure_set_uint, &priority },
+ &GNUNET_getopt_configure_set_uint, &priority },
{ 'u', "uri-files", NULL, "Make .uri files visible", 0,
- &gnunet_getopt_configure_set_one, &uri_files },
+ &GNUNET_getopt_configure_set_one, &uri_files },
{ 'x', "Xfuse", NULL, "Escape fuse option", 1,
&getopt_configure_argv, NULL },
- COMMAND_LINE_OPTION_END,
+ GNUNET_COMMAND_LINE_OPTION_END,
};
int main(int argc, char **argv)
@@ -114,7 +113,7 @@
/* Initialize fuse options */
fuse_argc = 1;
- fuse_argv = MALLOC(sizeof(char *) * argc);
+ fuse_argv = GNUNET_malloc(sizeof(char *) * argc);
fuse_argv[0] = argv[0];
fuse_argv[1] = NULL;
@@ -129,8 +128,8 @@
}
/* Set up log file */
- disk_directory_create_for_file(ectx, cfgLogfile);
- ectx = GE_create_context_logfile(ectx, GE_ALL, cfgLogfile, YES, 0);
+ GNUNET_disk_directory_create_for_file(ectx, cfgLogfile);
+ ectx = GE_create_context_logfile(ectx, GE_ALL, cfgLogfile, NULL,
GNUNET_YES, 0);
GE_setDefaultContext(ectx);
/* There should be exactly two extra arguments */
@@ -143,29 +142,29 @@
/* Set URI as our root directory entry */
gn_dirent_cache_init();
- if(disk_file_test(ectx, argv[i]) == YES)
+ if(GNUNET_disk_file_test(ectx, argv[i]) == GNUNET_YES)
{
guint64 len;
char *uribuf;
- root_fd = disk_file_open(ectx, argv[i], O_RDWR | O_SYNC);
+ root_fd = GNUNET_disk_file_open(ectx, argv[i], O_RDWR | O_SYNC);
if(root_fd == -1)
{
printf("Unable to open URI file: %s\n", argv[i]);
ret = -1;
goto quit;
}
- if(disk_file_size(ectx, argv[i], &len, YES) == SYSERR)
+ if(GNUNET_disk_file_size(ectx, argv[i], &len, GNUNET_YES) ==
GNUNET_SYSERR)
{
printf("Unable to determine URI file size\n");
ret = -1;
goto out_close_root;
}
- uribuf = MALLOC(len + 1);
+ uribuf = GNUNET_malloc(len + 1);
read(root_fd, uribuf, len);
uribuf[len] = '\0';
uri = ECRS_stringToUri(ectx, uribuf);
- FREE(uribuf);
+ GNUNET_free(uribuf);
if(uri == NULL)
{
printf("URI cannot be parsed\n");
@@ -193,7 +192,7 @@
{
/* In the case where the file does not exist, let's mount an
* empty directory and create the file to store its URI */
- root_fd = disk_file_open(ectx, argv[i], O_RDWR | O_SYNC
+ root_fd = GNUNET_disk_file_open(ectx, argv[i], O_RDWR | O_SYNC
| O_CREAT, 0666);
if(root_fd == -1)
{
@@ -205,7 +204,7 @@
}
/* Add mount point as the last fuse option */
- fuse_argv = REALLOC(fuse_argv, sizeof(char *) * (fuse_argc + 2));
+ fuse_argv = GNUNET_realloc(fuse_argv, sizeof(char *) * (fuse_argc + 2));
fuse_argv[fuse_argc] = argv[i + 1];
fuse_argc++;
fuse_argv[fuse_argc] = NULL;
@@ -222,12 +221,12 @@
ftruncate(root_fd, 0);
lseek(root_fd, SEEK_SET, 0);
write(root_fd, buf, strlen(buf));
- FREE(buf);
+ GNUNET_free(buf);
}
out_close_root:
- disk_file_close(ectx, argv[i], root_fd);
+ GNUNET_disk_file_close(ectx, argv[i], root_fd);
quit:
- FREE(fuse_argv);
+ GNUNET_free(fuse_argv);
GNUNET_fini(ectx, cfg);
return ret;
}
Modified: gnunet-fuse/mkdir.c
===================================================================
--- gnunet-fuse/mkdir.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/mkdir.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -53,7 +53,7 @@
de = gn_dirent_find(parent);
if(de == NULL)
{
- FREE(parent);
+ GNUNET_free(parent);
return -ENOENT;
}
meta = ECRS_createMetaData();
@@ -64,7 +64,7 @@
ret = gn_directory_insert(de, newde);
gn_dirent_put(de);
gn_dirent_put(newde);
- FREE(parent);
+ GNUNET_free(parent);
if(ret == -1)
return -EIO;
return 0;
Modified: gnunet-fuse/mknod.c
===================================================================
--- gnunet-fuse/mknod.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/mknod.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -58,13 +58,13 @@
de = gn_dirent_find(parent);
if(de == NULL)
{
- FREE(parent);
+ GNUNET_free(parent);
return -ENOENT;
}
uri = ECRS_stringToUri(ectx, GN_EMPTY_FILE_URI);
meta = ECRS_createMetaData();
ECRS_addToMetaData(meta, EXTRACTOR_FILENAME, file);
- FREE(parent);
+ GNUNET_free(parent);
newde = gn_dirent_new(path, uri, meta, DE_FILE);
ECRS_freeMetaData(meta);
ECRS_freeUri(uri);
Modified: gnunet-fuse/read.c
===================================================================
--- gnunet-fuse/read.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/read.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -33,7 +33,7 @@
};
static void dpcb(unsigned long long totalBytes,
- unsigned long long completedBytes, cron_t eta,
+ unsigned long long completedBytes, GNUNET_CronTime eta,
unsigned long long lastBlockOffset, const char *lastBlock,
unsigned int lastBlockSize, void *cls)
{
@@ -72,7 +72,7 @@
static int tt(void *cls)
{
(void)cls;
- return fuse_interrupted() ? SYSERR : OK;
+ return fuse_interrupted() ? GNUNET_SYSERR : GNUNET_OK;
}
int gn_read(const char *path, char *buf, size_t size, off_t offset,
@@ -98,7 +98,7 @@
slen = strlen(special);
if(offset >= slen)
{
- FREE(special);
+ GNUNET_free(special);
return 0;
}
if(offset + size > slen)
@@ -106,7 +106,7 @@
size = slen - offset;
}
memcpy(buf, special + offset, size);
- FREE(special);
+ GNUNET_free(special);
return size;
}
@@ -125,7 +125,7 @@
size = -ENOENT;
goto out;
}
- if(SEMAPHORE_DOWN(de->de_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(de->de_sema, GNUNET_YES) == GNUNET_SYSERR)
{
size = -EIO;
goto out;
@@ -153,15 +153,15 @@
d.size = size;
d.offset = offset;
ret = ECRS_downloadPartialFile(ectx, cfg, de->de_fi.uri, "/dev/null",
- offset, size, anonymity, YES, dpcb, &d, tt, NULL);
- if(ret != OK)
+ offset, size, anonymity, GNUNET_YES, dpcb, &d, tt, NULL);
+ if(ret != GNUNET_OK)
{
GE_LOG(ectx, GE_BULK | GE_USER | GE_ERROR,
"%s: failed to download file\n", __FUNCTION__);
size = -ENODATA;
}
out_sema_up:
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
out:
gn_dirent_put(de);
return size;
Modified: gnunet-fuse/readdir.c
===================================================================
--- gnunet-fuse/readdir.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/readdir.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -45,18 +45,18 @@
if(d->prefix != NULL)
{
- char *buf = MALLOC(strlen(d->prefix) + strlen(de->de_basename)
+ char *buf = GNUNET_malloc(strlen(d->prefix) +
strlen(de->de_basename)
+ 1);
sprintf(buf, "%s%s", d->prefix, de->de_basename);
d->filler(d->buf, buf, NULL, 0);
- FREE(buf);
+ GNUNET_free(buf);
}
else
{
d->filler(d->buf, de->de_basename, NULL, 0);
}
- return OK;
+ return GNUNET_OK;
}
int gn_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
Modified: gnunet-fuse/rename.c
===================================================================
--- gnunet-fuse/rename.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/rename.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -80,7 +80,7 @@
/* Now we can remove the 'from' */
from_parent = gn_dirname(from, &from_file);
from_parent_de = gn_dirent_find(from_parent);
- FREE(from_parent);
+ GNUNET_free(from_parent);
if(from_parent_de == NULL)
{
ret = -ENOENT;
@@ -97,7 +97,7 @@
/* Replace the 'to' */
to_parent = gn_dirname(to, &to_file);
to_parent_de = gn_dirent_find(to_parent);
- FREE(to_parent);
+ GNUNET_free(to_parent);
if(to_parent_de == NULL)
{
ret = -EIO;
Modified: gnunet-fuse/rmdir.c
===================================================================
--- gnunet-fuse/rmdir.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/rmdir.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -63,7 +63,7 @@
/* Remove directory */
parent = gn_dirname(path, &file);
de = gn_dirent_find(parent);
- FREE(parent);
+ GNUNET_free(parent);
if(de == NULL)
{
gn_dirent_put(dechild);
Modified: gnunet-fuse/special_file.c
===================================================================
--- gnunet-fuse/special_file.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/special_file.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -27,7 +27,7 @@
{
char *parent, *slash;
- parent = STRDUP(path);
+ parent = GNUNET_strdup(path);
slash = strrchr(parent, G_DIR_SEPARATOR);
if(slash != NULL)
{
@@ -55,20 +55,20 @@
}
else if(strncmp(file, URI_FILE ".", URI_LEN + 1) == 0)
{
- char *actual_file = MALLOC(strlen(path));
+ char *actual_file = GNUNET_malloc(strlen(path));
/* Return URI of the file named after the .uri. */
sprintf(actual_file, "%s" G_DIR_SEPARATOR_S "%s", parent,
&file[URI_LEN + 1]);
de = gn_dirent_find(actual_file);
- FREE(actual_file);
+ GNUNET_free(actual_file);
if(de == NULL)
goto out;
gn_dirent_put(de);
ret = 1;
}
out:
- FREE(parent);
+ GNUNET_free(parent);
return ret;
}
@@ -90,7 +90,7 @@
de = gn_dirent_find(parent);
if(de == NULL)
goto out;
- if(SEMAPHORE_DOWN(de->de_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(de->de_sema, GNUNET_YES) ==
GNUNET_SYSERR)
{
gn_dirent_put(de);
goto out;
@@ -99,29 +99,29 @@
{
if(gn_directory_upload_locked(de) == -1)
{
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
gn_dirent_put(de);
goto out;
}
}
buf = ECRS_uriToString(de->de_fi.uri);
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
gn_dirent_put(de);
- buf = REALLOC(buf, strlen(buf) + 2);
+ buf = GNUNET_realloc(buf, strlen(buf) + 2);
strcat(buf, "\n");
}
else if(strncmp(file, URI_FILE ".", URI_LEN + 1) == 0)
{
- char *actual_file = MALLOC(strlen(path));
+ char *actual_file = GNUNET_malloc(strlen(path));
/* Return URI of the file named after the .uri. */
sprintf(actual_file, "%s" G_DIR_SEPARATOR_S "%s", parent,
&file[URI_LEN + 1]);
de = gn_dirent_find(actual_file);
- FREE(actual_file);
+ GNUNET_free(actual_file);
if(de == NULL)
goto out;
- if(SEMAPHORE_DOWN(de->de_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(de->de_sema, GNUNET_YES) ==
GNUNET_SYSERR)
{
gn_dirent_put(de);
goto out;
@@ -132,7 +132,7 @@
{
if(gn_directory_upload_locked(de) == -1)
{
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
gn_dirent_put(de);
goto out;
}
@@ -141,19 +141,19 @@
{
if(de->de_fi.uri == NULL)
{
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
gn_dirent_put(de);
goto out;
}
}
}
buf = ECRS_uriToString(de->de_fi.uri);
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
gn_dirent_put(de);
- buf = REALLOC(buf, strlen(buf) + 2);
+ buf = GNUNET_realloc(buf, strlen(buf) + 2);
strcat(buf, "\n");
}
out:
- FREE(parent);
+ GNUNET_free(parent);
return buf;
}
Modified: gnunet-fuse/unlink.c
===================================================================
--- gnunet-fuse/unlink.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/unlink.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -53,7 +53,7 @@
/* Remove file from parent dir */
parent = gn_dirname(path, &file);
de = gn_dirent_find(parent);
- FREE(parent);
+ GNUNET_free(parent);
if(de == NULL)
{
gn_dirent_put(dechild);
Modified: gnunet-fuse/utimens.c
===================================================================
--- gnunet-fuse/utimens.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/utimens.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -44,7 +44,7 @@
return -ENOENT;
/* If it's a cached file just call utime */
- if(SEMAPHORE_DOWN(de->de_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(de->de_sema, GNUNET_YES) == GNUNET_SYSERR)
{
gn_dirent_put(de);
return -EIO;
@@ -66,7 +66,7 @@
/* For now we do nothing otherwise */
out:
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
gn_dirent_put(de);
return ret;
}
Modified: gnunet-fuse/write.c
===================================================================
--- gnunet-fuse/write.c 2007-11-23 18:08:59 UTC (rev 5746)
+++ gnunet-fuse/write.c 2007-11-24 05:08:01 UTC (rev 5747)
@@ -57,7 +57,7 @@
}
/* We must be cached */
- if(SEMAPHORE_DOWN(de->de_sema, YES) == SYSERR)
+ if(GNUNET_semaphore_down(de->de_sema, GNUNET_YES) == GNUNET_SYSERR)
{
size = -EIO;
goto out;
@@ -81,7 +81,7 @@
/* Mark us dirty */
de->de_dirty = 1;
out_unlock:
- SEMAPHORE_UP(de->de_sema);
+ GNUNET_semaphore_up(de->de_sema);
out:
gn_dirent_put(de);
return size;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r5747 - gnunet-fuse,
gnunet <=