Much simpler and safer ttyname() using B_GET_PATH_FOR_DEVICE. Also added ttyname_r for which we had a proto in the headers.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20133 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1616,6 +1616,8 @@ devfs_ioctl(fs_volume _fs, fs_vnode _vnode, fs_cookie _cookie, ulong op,
|
||||
*/
|
||||
strcpy(path, "/dev/");
|
||||
get_device_name(vnode, path + 5, sizeof(path) - 5);
|
||||
if (length && (length <= strlen(path)))
|
||||
return ERANGE;
|
||||
return user_strlcpy((char *)buffer, path, sizeof(path));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user