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:
François Revol
2007-02-15 14:01:40 +00:00
parent 5a34a44314
commit 158a9c384b
2 changed files with 38 additions and 55 deletions
+2
View File
@@ -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));
}