Skip to content

Commit

Permalink
packagefs: Package::Open(): Also log error code
Browse files Browse the repository at this point in the history
  • Loading branch information
weinhold committed Oct 29, 2014
1 parent fdb2d5d commit 53aae3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/add-ons/kernel/file_systems/packagefs/package/Package.cpp
Expand Up @@ -945,14 +945,16 @@ Package::Open()
// open the file
fFD = openat(fPackagesDirectory->DirectoryFD(), fFileName, O_RDONLY);
if (fFD < 0) {
ERROR("Failed to open package file \"%s\"\n", fFileName.Data());
ERROR("Failed to open package file \"%s\": %s\n", fFileName.Data(),
strerror(errno));
return errno;
}

// stat it to verify that it's still the same file
struct stat st;
if (fstat(fFD, &st) < 0) {
ERROR("Failed to stat package file \"%s\"\n", fFileName.Data());
ERROR("Failed to stat package file \"%s\": %s\n", fFileName.Data(),
strerror(errno));
close(fFD);
fFD = -1;
return errno;
Expand Down

0 comments on commit 53aae3d

Please sign in to comment.