mount_mfs: why chdir?

Mouse <[email protected]> Wed, 26 Mar 2025 09:00:33 -0400 (EDT)
Newsgroups gmane.os.netbsd.devel.userlevel
Message-ID <[email protected]>
In sbin/newfs/newfs.c, I see, inter alia,

int
main(int argc, char *argv[])
{
...
#ifdef MFS
	if (mfs) {
...
		(void) chdir("/");
...
		if (mount(MOUNT_MFS, ...) == -1)

Does anyone happen to know why the chdir to / is there?  It breaks
mount_mfs with a relative path as the mount-on argument, which is
somewhat confusing ("mkdir foo && mount_mfs -s 8192 swap foo" => No
such file or directory -> huh? I just made it!) and breaks a use case I
have - an unusual use case, but still.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		[email protected]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B