Modify GetSymLinkStr for platforms that return ERANGE when buffer is too small, like HP_UX; tweak field splitting in crc32 test-harness test, for platforms that separate cksum fields with tabs, like Solaris 10 & maybe earlier.
This commit is contained in:
parent
159e735ebc
commit
03bca0ebd4
|
@ -99,7 +99,15 @@ bool cFSPropCalc::GetSymLinkStr(const TSTRING& strName, cArchive& arch, size_t s
|
|||
#endif
|
||||
|
||||
if(rtn == -1)
|
||||
{
|
||||
// Some OSes (like HP-UX) return ERANGE if buffer is too small.
|
||||
// This is nonstandard but better than the usual truncate-and-say-you-succeeded
|
||||
//
|
||||
if(ERANGE == errno)
|
||||
return GetSymLinkStr(strName, arch, size*2);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//Sadly if buf isn't big enough readlink 'succeeds' by truncating the string, so the only
|
||||
// clue your buffer might be too small is if you maxed it out. So we try again, within reason.
|
||||
|
|
|
@ -34,8 +34,10 @@ sub run() {
|
|||
printf("%-30s", "-- $description");
|
||||
|
||||
# lets see if the system 'cksum' agree's with siggen's crc32 value
|
||||
# Doing split with ' ' instead of / / because some flavors of cksum
|
||||
# like to separate fields with tabs, as seen on Solaris 10.
|
||||
#
|
||||
my ($crc32, undef) = split(/ /, `cksum $twtools::twrootdir/test`);
|
||||
my ($crc32, undef) = split(' ', `cksum $twtools::twrootdir/test`);
|
||||
|
||||
if ($crc32 eq "") {
|
||||
++$twtools::twskippedtests;
|
||||
|
|
Loading…
Reference in New Issue