tools/stat: correctly test errno for buffer doubling
This commit is contained in:
parent
4d538190f2
commit
d9f9ca9a43
@ -120,7 +120,12 @@ void do_xattr (char const *path)
|
||||
|
||||
while (true) {
|
||||
auto const res = getxattr (path, keybuffer.c_str (), val.data (), val.size ());
|
||||
if (res == E2BIG) {
|
||||
if (res < 0 && errno == E2BIG) {
|
||||
val = "___E2BIG";
|
||||
break;
|
||||
}
|
||||
|
||||
if (res < 0 && errno == ERANGE) {
|
||||
val.resize (val.size () * 2);
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user