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:
parent
177ba8cb42
commit
7d03c9cbce
@ -70,13 +70,12 @@ __filesizebits( struct statfs* s )
|
||||
};
|
||||
int nn = 0;
|
||||
|
||||
for (;;) {
|
||||
if ( known64[nn] == EOL_MAGIC )
|
||||
return 32;
|
||||
|
||||
if ( known64[nn] == s->f_type )
|
||||
for (; known64[nn] != EOL_MAGIC; ++nn) {
|
||||
if (known64[nn] == s->f_type) {
|
||||
return 64;
|
||||
}
|
||||
}
|
||||
return 32;
|
||||
}
|
||||
|
||||
|
||||
@ -99,12 +98,10 @@ __link_max( struct statfs* s )
|
||||
};
|
||||
int nn = 0;
|
||||
|
||||
for (;;) {
|
||||
if ( knownMax[nn].type == EOL_MAGIC )
|
||||
return LINK_MAX;
|
||||
|
||||
if ( knownMax[nn].type == s->f_type )
|
||||
for (; knownMax[nn].type != EOL_MAGIC; ++nn) {
|
||||
if (knownMax[nn].type == s->f_type) {
|
||||
return knownMax[nn].max;
|
||||
}
|
||||
}
|
||||
return LINK_MAX;
|
||||
}
|
||||
@ -121,12 +118,12 @@ __2_symlinks( struct statfs* s )
|
||||
};
|
||||
int nn = 0;
|
||||
|
||||
for (;;) {
|
||||
if (knownNoSymlinks[nn] == 0)
|
||||
return 1;
|
||||
if (knownNoSymlinks[nn] == s->f_type)
|
||||
for (; knownNoSymlinks[nn] != EOL_MAGIC; ++nn) {
|
||||
if (knownNoSymlinks[nn] == s->f_type) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
static long
|
||||
|
Loading…
Reference in New Issue
Block a user