kernel/vfs: Fix shadowed variables.

The -Werror=uninitialized caught this, but I fixed it the wrong way
rather than looking at the code a little closer.

Should fix the strange bugs that cropped up after the first VFS patch.
This commit is contained in:
Augustin Cavalier
2019-01-22 21:37:15 -05:00
parent 7e4621737c
commit f22ee592d6
+4 -4
View File
@@ -9554,7 +9554,7 @@ _user_read_stat(int fd, const char* userPath, bool traverseLink,
struct stat* userStat, size_t statSize) struct stat* userStat, size_t statSize)
{ {
struct stat stat; struct stat stat;
status_t status = B_OK; status_t status;
if (statSize > sizeof(struct stat)) if (statSize > sizeof(struct stat))
return B_BAD_VALUE; return B_BAD_VALUE;
@@ -9573,7 +9573,7 @@ _user_read_stat(int fd, const char* userPath, bool traverseLink,
char* path = pathBuffer.LockBuffer(); char* path = pathBuffer.LockBuffer();
status_t status = user_copy_name(path, userPath, B_PATH_NAME_LENGTH); status = user_copy_name(path, userPath, B_PATH_NAME_LENGTH);
if (status != B_OK) if (status != B_OK)
return status; return status;
@@ -9617,7 +9617,7 @@ _user_write_stat(int fd, const char* userPath, bool traverseLeafLink,
if (statSize < sizeof(struct stat)) if (statSize < sizeof(struct stat))
memset((uint8*)&stat + statSize, 0, sizeof(struct stat) - statSize); memset((uint8*)&stat + statSize, 0, sizeof(struct stat) - statSize);
status_t status = B_OK; status_t status;
if (userPath != NULL) { if (userPath != NULL) {
// path given: write the stat of the node referred to by (fd, path) // path given: write the stat of the node referred to by (fd, path)
@@ -9630,7 +9630,7 @@ _user_write_stat(int fd, const char* userPath, bool traverseLeafLink,
char* path = pathBuffer.LockBuffer(); char* path = pathBuffer.LockBuffer();
status_t status = user_copy_name(path, userPath, B_PATH_NAME_LENGTH); status = user_copy_name(path, userPath, B_PATH_NAME_LENGTH);
if (status != B_OK) if (status != B_OK)
return status; return status;