summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-09-19 08:13:26 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-09-22 09:02:17 +0200
commit0ef49e125811ddb750403f02a091fd892b595fdf (patch)
tree74ef0a098e3afd35ec13de407dad98960e5952df
parent3628f1479b9fb77bed1ba4ab8e93ee98e14d9960 (diff)
hurd: add symbolic name for the mtab translator
* hurd/paths.h (_HURD_MTAB): New macro. * procfs/rootdir.c (rootdir_mounts_get_translator): Use the new macro. (rootdir_mounts_exists): Likewise.
-rw-r--r--hurd/paths.h2
-rw-r--r--procfs/rootdir.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/hurd/paths.h b/hurd/paths.h
index 48771325..92875b2b 100644
--- a/hurd/paths.h
+++ b/hurd/paths.h
@@ -52,5 +52,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#define _HURD_FIFO _HURD "fifo" /* S_IFIFO */
#define _HURD_IFSOCK _HURD "ifsock" /* S_IFSOCK */
+/* Symbolic names for all non-essential translators. */
+#define _HURD_MTAB _HURD "mtab"
#endif /* hurd/paths.h */
diff --git a/procfs/rootdir.c b/procfs/rootdir.c
index 0b131192..95410598 100644
--- a/procfs/rootdir.c
+++ b/procfs/rootdir.c
@@ -407,9 +407,6 @@ rootdir_gc_fakeself (void *hook, char **contents, ssize_t *contents_len)
return 0;
}
-/* The mtab translator to use by default for the "mounts" node. */
-#define MTAB_TRANSLATOR "/hurd/mtab"
-
static struct node *rootdir_mounts_node;
static pthread_spinlock_t rootdir_mounts_node_lock =
PTHREAD_SPINLOCK_INITIALIZER;
@@ -454,7 +451,7 @@ rootdir_mounts_make_node (void *dir_hook, const void *entry_hook)
static error_t
rootdir_mounts_get_translator (void *hook, char **argz, size_t *argz_len)
{
- static const char const mtab_argz[] = MTAB_TRANSLATOR "\0/";
+ static const char const mtab_argz[] = _HURD_MTAB "\0/";
*argz = malloc (sizeof mtab_argz);
if (! *argz)
@@ -470,7 +467,7 @@ rootdir_mounts_exists (void *dir_hook, const void *entry_hook)
{
static int translator_exists = -1;
if (translator_exists == -1)
- translator_exists = access (MTAB_TRANSLATOR, F_OK|X_OK) == 0;
+ translator_exists = access (_HURD_MTAB, F_OK|X_OK) == 0;
return translator_exists;
}