summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-02-11 23:15:15 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-02-11 23:15:15 +0000
commitc9fc3cbc0449b0b67a5e491fe8c492442c120843 (patch)
tree04c3cb4e194f3e507fcd0fefd455f04c518cdc0c
parent647c57259146571b78107e5e8bcfc9b6c81bc031 (diff)
Fix build against libpthreadgopherfs/master
* Makefile (HURDLIBS): Add -lshouldbeinlibc * gopherfs.h: Include <pthread.h> instead of <cthreads.h>, use pthread functions instead of cthreads functions.
-rw-r--r--Makefile2
-rw-r--r--gopherfs.h3
-rw-r--r--netfs.c8
3 files changed, 6 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index a0625203e..e9bbdc92a 100644
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,7 @@ SRCS = gopherfs.c args.c netfs.c gopher.c node.c fs.c debug.c dir.c
LCLHDRS = gopherfs.h fs.h debug.h
OBJS = $(SRCS:.c=.o)
-HURDLIBS = -lnetfs -lfshelp -liohelp -lports
+HURDLIBS = -lnetfs -lfshelp -liohelp -lports -lshouldbeinlibc
INSTALL = install
diff --git a/gopherfs.h b/gopherfs.h
index 376bec482..8e3921c55 100644
--- a/gopherfs.h
+++ b/gopherfs.h
@@ -22,10 +22,9 @@
#define __GOPHERFS_H__
#include <stdlib.h>
-#include <cthreads.h>
#include <maptime.h>
#include <sys/stat.h>
-/* #include <pthreads.h> */
+#include <pthread.h>
#include <error.h>
#include <netdb.h>
diff --git a/netfs.c b/netfs.c
index bcd6e093b..b1c9dc19a 100644
--- a/netfs.c
+++ b/netfs.c
@@ -45,7 +45,7 @@ netfs_attempt_create_file (struct iouser *user, struct node *dir,
char *name, mode_t mode, struct node **node)
{
*node = NULL;
- mutex_unlock (&dir->lock);
+ pthread_mutex_unlock (&dir->lock);
return EROFS;
}
@@ -299,7 +299,7 @@ netfs_attempt_lookup (struct iouser *user, struct node *dir,
;
if (nd)
- mutex_lock (&nd->lock);
+ pthread_mutex_lock (&nd->lock);
else
err = ENOENT;
@@ -310,7 +310,7 @@ netfs_attempt_lookup (struct iouser *user, struct node *dir,
if (!err)
netfs_nref (*node);
- mutex_unlock (&dir->lock);
+ pthread_mutex_unlock (&dir->lock);
return err;
}
@@ -469,7 +469,7 @@ netfs_attempt_mkfile (struct iouser *user, struct node *dir,
mode_t mode, struct node ** node)
{
*node = NULL;
- mutex_unlock (&dir->lock);
+ pthread_mutex_unlock (&dir->lock);
return EROFS;
}