MFC rev. 1.89, 1.90:
Apply the LCONVPATH() to the (old) linux_stat() and linux_lstat() syscalls.
This commit is contained in:
parent
857278f438
commit
ee9ecbab7b
@ -270,15 +270,22 @@ int
|
||||
linux_stat(struct thread *td, struct linux_stat_args *args)
|
||||
{
|
||||
struct stat buf;
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
LCONVPATHEXIST(td, args->path, &path);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (ldebug(stat))
|
||||
printf(ARGS(stat, "%s, *"), args->path);
|
||||
printf(ARGS(stat, "%s, *"), path);
|
||||
#endif
|
||||
error = kern_stat(td, args->path, UIO_SYSSPACE, &buf);
|
||||
if (error)
|
||||
error = kern_stat(td, path, UIO_SYSSPACE, &buf);
|
||||
if (error) {
|
||||
LFREEPATH(path);
|
||||
return (error);
|
||||
translate_path_major_minor(td, args->path, &buf);
|
||||
}
|
||||
translate_path_major_minor(td, path, &buf);
|
||||
LFREEPATH(path);
|
||||
return(stat_copyout(&buf, args->up));
|
||||
}
|
||||
|
||||
@ -286,16 +293,22 @@ int
|
||||
linux_lstat(struct thread *td, struct linux_lstat_args *args)
|
||||
{
|
||||
struct stat buf;
|
||||
char *path;
|
||||
int error;
|
||||
|
||||
LCONVPATHEXIST(td, args->path, &path);
|
||||
|
||||
#ifdef DEBUG
|
||||
if (ldebug(lstat))
|
||||
printf(ARGS(lstat, "%s, *"), args->path);
|
||||
printf(ARGS(lstat, "%s, *"), path);
|
||||
#endif
|
||||
error = kern_lstat(td, args->path, UIO_SYSSPACE, &buf);
|
||||
if (error)
|
||||
error = kern_lstat(td, path, UIO_SYSSPACE, &buf);
|
||||
if (error) {
|
||||
LFREEPATH(path);
|
||||
return (error);
|
||||
translate_path_major_minor(td, args->path, &buf);
|
||||
}
|
||||
translate_path_major_minor(td, path, &buf);
|
||||
LFREEPATH(path);
|
||||
return(stat_copyout(&buf, args->up));
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user