diff options
author | dchagin <dchagin@FreeBSD.org> | 2015-01-11 07:02:03 +0000 |
---|---|---|
committer | dchagin <dchagin@FreeBSD.org> | 2015-01-11 07:02:03 +0000 |
commit | 4f4ad9e7dd421d2d208fb3478dfc62a30c7bd6c2 (patch) | |
tree | 22b3b5538ebc14366ea7b0e1da71eb92aefcf4d2 /sys/kern | |
parent | 11947f9f2cfc44c72828b69b62c16c142234d5b4 (diff) | |
download | FreeBSD-src-4f4ad9e7dd421d2d208fb3478dfc62a30c7bd6c2.zip FreeBSD-src-4f4ad9e7dd421d2d208fb3478dfc62a30c7bd6c2.tar.gz |
MFC r276564, r276654:
Cast *path to silence clang -Wpointer-sign warning.
Indeed, instead of hiding the kern___getcwd() bug by bogus cast
in r276564, change path type to char * (pathnames are always char *).
And remove bogus casts of malloc().
kern___getcwd() internally doesn't actually use or support u_char *
paths, except to copy them to a normal char * path.
These changes are not visible to libc as libc/gen/getcwd.c misdeclares
__getcwd() as taking a plain char * path.
While here remove _SYS_SYSPROTO_H_ for __getcwd() syscall as
we always have sysproto.h.
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/syscalls.master | 2 | ||||
-rw-r--r-- | sys/kern/vfs_cache.c | 10 |
2 files changed, 2 insertions, 10 deletions
diff --git a/sys/kern/syscalls.master b/sys/kern/syscalls.master index 15c2d12..09b9273 100644 --- a/sys/kern/syscalls.master +++ b/sys/kern/syscalls.master @@ -571,7 +571,7 @@ 323 AUE_NULL OBSOL thr_wakeup 324 AUE_MLOCKALL STD { int mlockall(int how); } 325 AUE_MUNLOCKALL STD { int munlockall(void); } -326 AUE_GETCWD STD { int __getcwd(u_char *buf, u_int buflen); } +326 AUE_GETCWD STD { int __getcwd(char *buf, u_int buflen); } 327 AUE_NULL STD { int sched_setparam (pid_t pid, \ const struct sched_param *param); } diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 3ba66e2..17f72a7 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -1044,14 +1044,6 @@ vfs_cache_lookup(ap) return (error); } - -#ifndef _SYS_SYSPROTO_H_ -struct __getcwd_args { - u_char *buf; - u_int buflen; -}; -#endif - /* * XXX All of these sysctls would probably be more productive dead. */ @@ -1070,7 +1062,7 @@ sys___getcwd(td, uap) } int -kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg, u_int buflen) +kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, u_int buflen) { char *bp, *tmpbuf; struct filedesc *fdp; |