summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2013-06-30 10:51:57 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2013-06-30 10:51:57 +0000
commit87b7ee9e740940881b0a431f5149512091ff1bcd (patch)
tree25685ad68d327588bb19de0c5b1354ed6891dd5c
parentb343945a53dbe40c39fd708f6f933bee2a609483 (diff)
Fix socketio build
* Makefile: New file. * version.h: New file. * socketio.c: Include "version.h" instead of <version.h>. (netfs_S_dir_lookup, netfs_attempt_lookup_improved, netfs_attempt_create_file): Use pthread_mutex_lock/unlock instead of mutex_lock/unlock.
-rw-r--r--Makefile3
-rw-r--r--socketio.c16
-rw-r--r--version.h29
3 files changed, 40 insertions, 8 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000..f029d5ea3
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,3 @@
+CFLAGS=-D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -O2
+LDLIBS=-lnetfs -lfshelp -liohelp -lports -lshouldbeinlibc
+all: socketio
diff --git a/socketio.c b/socketio.c
index 4fcc46e2a..9d578f344 100644
--- a/socketio.c
+++ b/socketio.c
@@ -42,7 +42,7 @@
#include <hurd/iohelp.h>
#include <maptime.h>
-#include <version.h>
+#include "version.h"
/* Netfs initialization. */
@@ -534,13 +534,13 @@ netfs_S_dir_lookup (struct protid *diruser,
/* Set things up in the state expected by the code from gotit: on. */
dnp = 0;
np = diruser->po->np;
- mutex_lock (&np->lock);
+ pthread_mutex_lock (&np->lock);
netfs_nref (np);
goto gotit;
}
dnp = diruser->po->np;
- mutex_lock (&dnp->lock);
+ pthread_mutex_lock (&dnp->lock);
netfs_nref (dnp); /* acquire a reference for later netfs_nput */
@@ -582,7 +582,7 @@ netfs_S_dir_lookup (struct protid *diruser,
if (! lastcomp)
strcpy (retry_name, nextname);
err = 0;
- mutex_unlock (&dnp->lock);
+ pthread_mutex_unlock (&dnp->lock);
goto out;
}
else if (diruser->po->root_parent != MACH_PORT_NULL)
@@ -596,7 +596,7 @@ netfs_S_dir_lookup (struct protid *diruser,
if (!lastcomp)
strcpy (retry_name, nextname);
err = 0;
- mutex_unlock (&dnp->lock);
+ pthread_mutex_unlock (&dnp->lock);
goto out;
}
else
@@ -743,11 +743,11 @@ netfs_attempt_lookup_improved (struct iouser *user, struct node *dir,
out:
fshelp_touch (&dir->nn_stat, TOUCH_ATIME, maptime);
- mutex_unlock (&dir->lock);
+ pthread_mutex_unlock (&dir->lock);
if (err)
*node = 0;
else if (*node)
- mutex_lock (&(*node)->lock);
+ pthread_mutex_lock (&(*node)->lock);
return err;
}
@@ -992,7 +992,7 @@ netfs_attempt_create_file (struct iouser *user, struct node *dir,
char *name, mode_t mode, struct node **np)
{
*np = 0;
- mutex_unlock (&dir->lock);
+ pthread_mutex_unlock (&dir->lock);
return EOPNOTSUPP;
}
diff --git a/version.h b/version.h
new file mode 100644
index 000000000..8969db313
--- /dev/null
+++ b/version.h
@@ -0,0 +1,29 @@
+/* Hurd version
+ Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
+ Written by Thomas Bushnell, n/BSG.
+
+ This file is part of the GNU Hurd.
+
+ The GNU Hurd is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ The GNU Hurd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
+
+#ifndef HURD_VERSION
+#define HURD_VERSION "0.3"
+#endif
+
+/* The standard way to print versions for --version. */
+#define STANDARD_HURD_VERSION(s) \
+ #s " (GNU Hurd) " HURD_VERSION
+#define STANDARD_HURD_VERSION_EXTRA(s, extra) \
+ #s " (GNU Hurd; " extra ") " HURD_VERSION