bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 1/3] libdiskfs: Allow SYMLOOP_MAX to be undefined


From: David Michael
Subject: [PATCH 1/3] libdiskfs: Allow SYMLOOP_MAX to be undefined
Date: Wed, 1 May 2013 21:10:32 -0400

POSIX systems are allowed to leave SYMLOOP_MAX undefined, and in such
cases applications are supposed to use sysconf.

* libdiskfs/boot-start.c (diskfs_start_bootstrap): Replace macro with sysconf.
---

According to the standard[1], an undefined SYMLOOP_MAX has a defined
interpretation.  The glibc sysconf implementation[2] should provide a
valid substitute for the macro.

[1] 
http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html#tag_13_23_03_01
[2] 
http://git.savannah.gnu.org/cgit/hurd/glibc.git/tree/sysdeps/mach/hurd/sysconf.c?h=tschwinge/Roger_Whittaker

 libdiskfs/boot-start.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libdiskfs/boot-start.c b/libdiskfs/boot-start.c
index 1e4a1c6..269edfa 100644
--- a/libdiskfs/boot-start.c
+++ b/libdiskfs/boot-start.c
@@ -237,7 +237,7 @@ diskfs_start_bootstrap ()
     }
   else if (retry == FS_RETRY_MAGICAL && pathbuf[0] == '/')
     {
-      assert (init_lookups < SYMLOOP_MAX);
+      assert (init_lookups < sysconf (_SC_SYMLOOP_MAX));

       /* INITNAME is a symlink with an absolute target, so try again.  */
       initname = strdupa (pathbuf);
--
1.8.1.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]