kernel/fd: Create the SyscallRestartWrapper before calling common_vector_io.

Otherwise, it seems compiler will optimize the assign operation into
a call of the first constructor, meaning the thread's syscall flag
won't be set properly.

Fixes #18951.
This commit is contained in:
Augustin Cavalier
2024-07-18 21:50:19 -04:00
parent bc19d91fb6
commit d72befae1e
+2 -2
View File
@@ -855,8 +855,8 @@ common_user_vector_io(int fd, off_t pos, const iovec* userVecs, size_t count,
if (error != B_OK)
return error;
SyscallRestartWrapper<ssize_t> result = common_vector_io(fd, pos,
vecs, count, write, false);
SyscallRestartWrapper<ssize_t> result;
result = common_vector_io(fd, pos, vecs, count, write, false);
return result;
}