1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 20:57:35 +00:00

Kernel: Remove SmapDisabler in watch_file()

This commit is contained in:
Andreas Kling 2020-01-05 21:55:20 +01:00
parent 80cbb72f2f
commit 152a83fac5

View file

@ -3435,17 +3435,17 @@ int Process::sys$ftruncate(int fd, off_t length)
return description->truncate(length); return description->truncate(length);
} }
int Process::sys$watch_file(const char* path, int path_length) int Process::sys$watch_file(const char* user_path, int path_length)
{ {
if (path_length < 0) if (path_length < 0)
return -EINVAL; return -EINVAL;
if (!validate_read(path, path_length)) if (!validate_read(user_path, path_length))
return -EFAULT; return -EFAULT;
SmapDisabler disabler; auto path = copy_string_from_user(user_path, path_length);
auto custody_or_error = VFS::the().resolve_path({ path, (size_t)path_length }, current_directory()); auto custody_or_error = VFS::the().resolve_path(path, current_directory());
if (custody_or_error.is_error()) if (custody_or_error.is_error())
return custody_or_error.error(); return custody_or_error.error();