Mail Archives: djgpp-workers/1999/02/24/16:09:30
> > chroot ("c:/djgpp")
> > getcwd would then return '/bin' if the cwd is 'c:/djgpp/bin'.
>
> Yes.
>
> I think _fixpath should do that as well, to prevent confusion, and also to
> be compatible with Unix description that every call to chroot interprets
> its argument *relative to the previous root*.
>
I've run into a problem with stat() and _fixpath.
void foo()
{
struct stat finfo;
chroot ("c:/djgpp");
if (stat ("c:/djgpp/bin", &finfo) < 0)
return -1;
}
The call to stat() fails because "c:/djgpp" is stripped so all it gets back
is "/bin" and since a call to _put_path is inappropriate, the root
expansion doesn't take place. There's also the case of chroot
("c:/djgpp"); stat ("/bin", &finfo); that fails for a similiar reason.
One solution would be to have a flag for _fixpath to tell it when not to
delete the root path from the output. I suppose another would be to not
delete the root path from the output at all, but it was said above we
want _fixpath to do that. Thoughts?
Mark
BTW, Thanks Nate for running the chroot test.
---
Mark Elbrecht
snowball3 AT usa DOT net http://members.xoom.com/snowball3/
- Raw text -