Skip to content

Change long to int64_t in common stat struct #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/libpsl-native/src/getcommonstat.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ PAL_BEGIN_EXTERNC

struct CommonStat
{
long Inode;
int64_t Inode;
int Mode;
int UserId;
int GroupId;
int HardlinkCount;
long Size;
long AccessTime;
long ModifiedTime;
long ChangeTime;
long BlockSize;
int64_t Size;
int64_t AccessTime;
int64_t ModifiedTime;
int64_t ChangeTime;
int64_t BlockSize;
int DeviceId;
int NumberOfBlocks;
int IsDirectory;
Expand Down
3 changes: 3 additions & 0 deletions src/libpsl-native/test/test-getcommonstat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ TEST(GetCommonStat, Mode002)
GetCommonStat(fname, &cs);
unlink(fname);
EXPECT_EQ(cs.Mode, buffer.st_mode);
EXPECT_EQ(cs.IsSetUid, 1);
}

TEST(GetCommonStat, Mode003)
Expand All @@ -291,6 +292,7 @@ TEST(GetCommonStat, Mode003)
GetCommonStat(fname, &cs);
unlink(fname);
EXPECT_EQ(cs.Mode, buffer.st_mode);
// don't check for IsSetGid as that can vary from platform based on file system
}

TEST(GetCommonStat, Mode004)
Expand All @@ -308,5 +310,6 @@ TEST(GetCommonStat, Mode004)
GetCommonStat(dname, &cs);
rmdir(dname);
EXPECT_EQ(cs.Mode, buffer.st_mode);
EXPECT_EQ(cs.IsSticky, 1);
}