Tracker: sbuf => statbuf used elsewhere, check GetStat() status.
Change-Id: I08515297712f1b36a513d944847c1383ba4e8158 Reviewed-on: https://review.haiku-os.org/c/haiku/+/10633 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
5187da4c76
commit
3c0110ad24
@@ -2682,12 +2682,12 @@ FSGetTrashDir(BDirectory* trashDir, dev_t dev)
|
|||||||
|
|
||||||
if (result == B_OK) {
|
if (result == B_OK) {
|
||||||
// make Trash directory invisible
|
// make Trash directory invisible
|
||||||
StatStruct sbuf;
|
|
||||||
trashDir->GetStat(&sbuf);
|
|
||||||
|
|
||||||
PoseInfo poseInfo;
|
PoseInfo poseInfo;
|
||||||
poseInfo.fInvisible = true;
|
poseInfo.fInvisible = true;
|
||||||
poseInfo.fInitedDirectory = sbuf.st_ino;
|
|
||||||
|
StatStruct statbuf;
|
||||||
|
poseInfo.fInitedDirectory = trashDir->GetStat(&statbuf) == B_OK ? statbuf.st_ino : -1LL;
|
||||||
|
|
||||||
trashDir->WriteAttr(kAttrPoseInfo, B_RAW_TYPE, 0, &poseInfo, sizeof(PoseInfo));
|
trashDir->WriteAttr(kAttrPoseInfo, B_RAW_TYPE, 0, &poseInfo, sizeof(PoseInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user