summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/inotify.cc
diff options
context:
space:
mode:
authorAdin Scannell <ascannell@google.com>2020-01-21 16:16:51 -0800
committergVisor bot <gvisor-bot@google.com>2020-01-21 17:28:57 -0800
commit2296b4734462b6eeef383ea58e2b1b0b1a214d76 (patch)
treed43601b814bef410fa660bad27acda667fa16d75 /test/syscalls/linux/inotify.cc
parent0693fb05d15dff29cba51988f19a8d5cea784162 (diff)
Change to standard types.
PiperOrigin-RevId: 290846481
Diffstat (limited to 'test/syscalls/linux/inotify.cc')
-rw-r--r--test/syscalls/linux/inotify.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/syscalls/linux/inotify.cc b/test/syscalls/linux/inotify.cc
index 182d676d5..fdef646eb 100644
--- a/test/syscalls/linux/inotify.cc
+++ b/test/syscalls/linux/inotify.cc
@@ -48,26 +48,26 @@ constexpr int kBufSize = 1024;
// C++-friendly version of struct inotify_event.
struct Event {
- int32 wd;
- uint32 mask;
- uint32 cookie;
- uint32 len;
+ int32_t wd;
+ uint32_t mask;
+ uint32_t cookie;
+ uint32_t len;
std::string name;
- Event(uint32 mask, int32 wd, absl::string_view name, uint32 cookie)
+ Event(uint32_t mask, int32_t wd, absl::string_view name, uint32_t cookie)
: wd(wd),
mask(mask),
cookie(cookie),
len(name.size()),
name(std::string(name)) {}
- Event(uint32 mask, int32 wd, absl::string_view name)
+ Event(uint32_t mask, int32_t wd, absl::string_view name)
: Event(mask, wd, name, 0) {}
- Event(uint32 mask, int32 wd) : Event(mask, wd, "", 0) {}
+ Event(uint32_t mask, int32_t wd) : Event(mask, wd, "", 0) {}
Event() : Event(0, 0, "", 0) {}
};
// Prints the symbolic name for a struct inotify_event's 'mask' field.
-std::string FlagString(uint32 flags) {
+std::string FlagString(uint32_t flags) {
std::vector<std::string> names;
#define EMIT(target) \
@@ -320,7 +320,7 @@ PosixErrorOr<FileDescriptor> InotifyInit1(int flags) {
}
PosixErrorOr<int> InotifyAddWatch(int fd, const std::string& path,
- uint32 mask) {
+ uint32_t mask) {
int wd;
EXPECT_THAT(wd = inotify_add_watch(fd, path.c_str(), mask),
SyscallSucceeds());
@@ -647,7 +647,7 @@ TEST(Inotify, MoveGeneratesEvents) {
Event(IN_MOVED_TO, root_wd, Basename(newpath), events[1].cookie)}));
EXPECT_NE(events[0].cookie, 0);
EXPECT_EQ(events[0].cookie, events[1].cookie);
- uint32 last_cookie = events[0].cookie;
+ uint32_t last_cookie = events[0].cookie;
// Test move from root -> root/dir1.
newpath = NewTempAbsPathInDir(dir1.path());
@@ -841,7 +841,7 @@ TEST(Inotify, ConcurrentThreadsGeneratingEvents) {
}
auto test_thread = [&files]() {
- uint32 seed = time(nullptr);
+ uint32_t seed = time(nullptr);
for (int i = 0; i < 20; i++) {
const TempPath& file = files[rand_r(&seed) % files.size()];
const FileDescriptor file_fd =
@@ -960,7 +960,7 @@ TEST(Inotify, BlockingReadOnInotifyFd) {
t.Join();
// Make sure the event we got back is sane.
- uint32 event_mask;
+ uint32_t event_mask;
memcpy(&event_mask, buf.data() + offsetof(struct inotify_event, mask),
sizeof(event_mask));
EXPECT_EQ(event_mask, IN_ACCESS);