Skip to content

Commit b45ca5d

Browse files
bgianfoawesomekling
authored andcommitted
Kernel+LibC: Pack SC_inode_watcher_add_watch_params struct better
Flagged by pvs-studio, ordering the members from largest to smallest allows us to save a few bytes in the size of the struct.
1 parent dba5710 commit b45ca5d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Kernel/API/Syscall.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,8 +474,8 @@ struct SC_set_coredump_metadata_params {
474474
};
475475

476476
struct SC_inode_watcher_add_watch_params {
477-
int fd;
478477
StringArgument user_path;
478+
int fd;
479479
u32 event_mask;
480480
};
481481

Userland/Libraries/LibC/fcntl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int create_inode_watcher(unsigned flags)
3232

3333
int inode_watcher_add_watch(int fd, const char* path, size_t path_length, unsigned event_mask)
3434
{
35-
Syscall::SC_inode_watcher_add_watch_params params { fd, { path, path_length }, event_mask };
35+
Syscall::SC_inode_watcher_add_watch_params params { { path, path_length }, fd, event_mask };
3636
int rc = syscall(SC_inode_watcher_add_watch, &params);
3737
__RETURN_WITH_ERRNO(rc, rc, -1);
3838
}

0 commit comments

Comments
 (0)