pathconf: dead loop in bionic function __2_symlinks

Fix dead loops in file ./bionic/libc/unistd/pathconf.c

Change-Id: I7a1e6bcd9879c96bacfd376b88a1f899793295c8
Author: Jin Wei <wei.a.jin@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
This commit is contained in:
Bruce Beare 2011-10-21 10:16:11 +08:00
parent 177ba8cb42
commit 7d03c9cbce

View File

@ -70,14 +70,13 @@ __filesizebits( struct statfs* s )
}; };
int nn = 0; int nn = 0;
for (;;) { for (; known64[nn] != EOL_MAGIC; ++nn) {
if ( known64[nn] == EOL_MAGIC ) if (known64[nn] == s->f_type) {
return 32;
if ( known64[nn] == s->f_type )
return 64; return 64;
} }
} }
return 32;
}
static long static long
@ -99,13 +98,11 @@ __link_max( struct statfs* s )
}; };
int nn = 0; int nn = 0;
for (;;) { for (; knownMax[nn].type != EOL_MAGIC; ++nn) {
if ( knownMax[nn].type == EOL_MAGIC ) if (knownMax[nn].type == s->f_type) {
return LINK_MAX;
if ( knownMax[nn].type == s->f_type )
return knownMax[nn].max; return knownMax[nn].max;
} }
}
return LINK_MAX; return LINK_MAX;
} }
@ -121,13 +118,13 @@ __2_symlinks( struct statfs* s )
}; };
int nn = 0; int nn = 0;
for (;;) { for (; knownNoSymlinks[nn] != EOL_MAGIC; ++nn) {
if (knownNoSymlinks[nn] == 0) if (knownNoSymlinks[nn] == s->f_type) {
return 1;
if (knownNoSymlinks[nn] == s->f_type)
return 0; return 0;
} }
} }
return 1;
}
static long static long
__name_max( struct statfs* s ) __name_max( struct statfs* s )