--- src/sys/emulation/linux/linux_file.c 2004/03/01 06:33:15 1.16 +++ src/sys/emulation/linux/linux_file.c 2004/09/30 18:59:38 1.17 @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -508,8 +509,7 @@ linux_unlink(struct linux_unlink_args *a int linux_chdir(struct linux_chdir_args *args) { - struct thread *td = curthread; - struct nameidata nd; + struct nlookupdata nd; char *path; int error; @@ -520,11 +520,11 @@ linux_chdir(struct linux_chdir_args *arg if (ldebug(chdir)) printf(ARGS(chdir, "%s"), path); #endif - NDINIT(&nd, NAMEI_LOOKUP, CNP_FOLLOW | CNP_LOCKLEAF, UIO_SYSSPACE, - path, td); - - error = kern_chdir(&nd); - + error = nlookup_init(&nd, path, UIO_SYSSPACE, NLC_FOLLOW); + if (error == 0) { + error = kern_chdir(&nd); + nlookup_done(&nd); + } linux_free_path(&path); return(error); }