_kern_read_link() ignored the path

This commit is contained in:
Ingo Weinhold 2011-06-30 19:05:28 +02:00
parent c29492a252
commit 640b4ed97d

View File

@ -863,15 +863,14 @@ _kern_create_symlink(int fd, const char *path, const char *toPath, int mode)
status_t status_t
_kern_read_link(int fd, const char *path, char *buffer, size_t *_bufferSize) _kern_read_link(int fd, const char *path, char *buffer, size_t *_bufferSize)
{ {
// get the descriptor // get the path
SymlinkDescriptor *descriptor string realPath;
= dynamic_cast<SymlinkDescriptor*>(get_descriptor(fd)); status_t error = get_path(fd, path, realPath);
if (!descriptor) if (error != B_OK)
return B_FILE_ERROR; return error;
// readlink // readlink
ssize_t bytesRead = readlink(descriptor->path.c_str(), buffer, ssize_t bytesRead = readlink(realPath.c_str(), buffer, *_bufferSize);
*_bufferSize);
if (bytesRead < 0) if (bytesRead < 0)
return errno; return errno;