Uses channame() in sys_fd2path()
authorBarret Rhoden <brho@cs.berkeley.edu>
Thu, 3 Apr 2014 23:11:30 +0000 (16:11 -0700)
committerBarret Rhoden <brho@cs.berkeley.edu>
Thu, 3 Apr 2014 23:11:30 +0000 (16:11 -0700)
commita219abde22803beb84c3e7c9af9ecaeeba2842ab
tree134f50e812c99f03fbf758636ae128de9e294724
parent59feae1cebdb027de30d1f94e83eb795f3a66d5b
Uses channame() in sys_fd2path()

channame() should do the trick, instead of the old chanpath() which was
removed in commit 011ab2.  If not, we should fix channame().  chanpath()
was a nxm thing; Inferno has different structs to track the name.
"chanpath(ch)" might have been put in quotes during the 9ns->inferno
change.

Using snprintf() and channame() helps with a couple things.  Previously,
fd2path() didn't check ch != 0 and could copy more than the user requested
(i.e. the full channame len instead of MIN(len, ch->name->len)).
kern/src/syscall.c