kernel/fs: rootfs and devfs readlink behavior change
Change-Id: I23ec687965493162594924c32f8ff31e7da396d7 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2753 Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
10b5c00fca
commit
bc231fc782
@@ -1185,10 +1185,11 @@ devfs_read_link(fs_volume* _volume, fs_vnode* _link, char* buffer,
|
|||||||
if (!S_ISLNK(link->stream.type))
|
if (!S_ISLNK(link->stream.type))
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
if (link->stream.u.symlink.length < *_bufferSize)
|
memcpy(buffer, link->stream.u.symlink.path, min_c(*_bufferSize,
|
||||||
*_bufferSize = link->stream.u.symlink.length;
|
link->stream.u.symlink.length));
|
||||||
|
|
||||||
|
*_bufferSize = link->stream.u.symlink.length;
|
||||||
|
|
||||||
memcpy(buffer, link->stream.u.symlink.path, *_bufferSize);
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -867,10 +867,11 @@ rootfs_read_link(fs_volume* _volume, fs_vnode* _link, char* buffer,
|
|||||||
if (!S_ISLNK(link->stream.type))
|
if (!S_ISLNK(link->stream.type))
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|
||||||
if (link->stream.symlink.length < *_bufferSize)
|
memcpy(buffer, link->stream.symlink.path, min_c(*_bufferSize,
|
||||||
*_bufferSize = link->stream.symlink.length;
|
link->stream.symlink.length));
|
||||||
|
|
||||||
|
*_bufferSize = link->stream.symlink.length;
|
||||||
|
|
||||||
memcpy(buffer, link->stream.symlink.path, *_bufferSize);
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user