summaryrefslogtreecommitdiff
path: root/libdiskfs
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs')
-rw-r--r--libdiskfs/boot-start.c14
-rw-r--r--libdiskfs/diskfs.h15
-rw-r--r--libdiskfs/extern-inline.c2
-rw-r--r--libdiskfs/io-pathconf.c1
4 files changed, 28 insertions, 4 deletions
diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c
index e73e4d37..15563bdb 100644
--- a/libdiskfs/boot-start.c
+++ b/libdiskfs/boot-start.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1993,94,95,96,97,98,99,2000,01,02,10
+ Copyright (C) 1993,94,95,96,97,98,99,2000,01,02,10,11
Free Software Foundation, Inc.
This file is part of the GNU Hurd.
@@ -104,6 +104,7 @@ diskfs_start_bootstrap ()
struct protid *rootpi;
struct peropen *rootpo;
mach_port_t diskfs_exec;
+ unsigned int init_lookups = 0;
/* Create the port for current and root directory. */
err = diskfs_make_peropen (diskfs_root_node, O_READ | O_EXEC, 0,
@@ -222,8 +223,10 @@ diskfs_start_bootstrap ()
initname = exec_argv + 1;
}
+ lookup_init:
err = dir_lookup (root_pt, initname, O_READ, 0,
&retry, pathbuf, &startup_pt);
+ init_lookups++;
if (err)
{
printf ("\nCannot find startup program `%s': %s\n",
@@ -232,6 +235,15 @@ diskfs_start_bootstrap ()
free (exec_argv);
assert_perror (err); /* XXX this won't reboot properly */
}
+ else if (retry == FS_RETRY_MAGICAL && pathbuf[0] == '/')
+ {
+ assert (init_lookups < SYMLOOP_MAX);
+
+ /* INITNAME is a symlink with an absolute target, so try again. */
+ initname = strdupa (pathbuf);
+ goto lookup_init;
+ }
+
assert (retry == FS_RETRY_NORMAL);
assert (pathbuf[0] == '\0');
diff --git a/libdiskfs/diskfs.h b/libdiskfs/diskfs.h
index 9a61964c..2051e41d 100644
--- a/libdiskfs/diskfs.h
+++ b/libdiskfs/diskfs.h
@@ -27,9 +27,12 @@
#include <hurd/fshelp.h>
#include <hurd/iohelp.h>
#include <idvec.h>
+#include <features.h>
-#ifndef DISKFS_EXTERN_INLINE
-#define DISKFS_EXTERN_INLINE extern inline
+#ifdef DISKFS_DEFINE_EXTERN_INLINE
+#define DISKFS_EXTERN_INLINE
+#else
+#define DISKFS_EXTERN_INLINE __extern_inline
#endif
/* Each user port referring to a file points to one of these
@@ -781,6 +784,12 @@ error_t diskfs_start_protid (struct peropen *po, struct protid **cred);
the user to install is USER. */
void diskfs_finish_protid (struct protid *cred, struct iouser *user);
+extern struct protid * diskfs_begin_using_protid_port (file_t port);
+
+extern void diskfs_end_using_protid_port (struct protid *cred);
+
+#if defined(__USE_EXTERN_INLINES) || defined(DISKFS_DEFINE_EXTERN_INLINE)
+
/* Called by MiG to translate ports into struct protid *.
fsmutations.h arranges for this to happen for the io and
fs interfaces. */
@@ -800,6 +809,8 @@ diskfs_end_using_protid_port (struct protid *cred)
ports_port_deref (cred);
}
+#endif /* Use extern inlines. */
+
/* Called when a protid CRED has no more references. (Because references\
to protids are maintained by the port management library, this is
installed in the clean routines list.) The ports library will
diff --git a/libdiskfs/extern-inline.c b/libdiskfs/extern-inline.c
index 0abcc4cc..43de88d6 100644
--- a/libdiskfs/extern-inline.c
+++ b/libdiskfs/extern-inline.c
@@ -15,6 +15,6 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
-#define DISKFS_EXTERN_INLINE
+#define DISKFS_DEFINE_EXTERN_INLINE
#include "diskfs.h"
diff --git a/libdiskfs/io-pathconf.c b/libdiskfs/io-pathconf.c
index b851f9b1..38e277c3 100644
--- a/libdiskfs/io-pathconf.c
+++ b/libdiskfs/io-pathconf.c
@@ -41,6 +41,7 @@ diskfs_S_io_pathconf (struct protid *cred,
case _PC_PIPE_BUF:
case _PC_VDISABLE:
case _PC_SOCK_MAXBUF:
+ case _PC_PATH_MAX:
*value = -1;
break;