From owner-svn-src-stable-10@FreeBSD.ORG Sun Jan 11 07:02:05 2015 Return-Path: Delivered-To: svn-src-stable-10@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 539CE16F; Sun, 11 Jan 2015 07:02:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3500DD98; Sun, 11 Jan 2015 07:02:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t0B725nH039935; Sun, 11 Jan 2015 07:02:05 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t0B723dO039929; Sun, 11 Jan 2015 07:02:03 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201501110702.t0B723dO039929@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 11 Jan 2015 07:02:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r276955 - in stable/10/sys: compat/freebsd32 compat/linux kern sys X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jan 2015 07:02:05 -0000 Author: dchagin Date: Sun Jan 11 07:02:03 2015 New Revision: 276955 URL: https://svnweb.freebsd.org/changeset/base/276955 Log: 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. Modified: stable/10/sys/compat/freebsd32/syscalls.master stable/10/sys/compat/linux/linux_getcwd.c stable/10/sys/kern/syscalls.master stable/10/sys/kern/vfs_cache.c stable/10/sys/sys/syscallsubr.h Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/10/sys/compat/freebsd32/syscalls.master Sun Jan 11 01:49:52 2015 (r276954) +++ stable/10/sys/compat/freebsd32/syscalls.master Sun Jan 11 07:02:03 2015 (r276955) @@ -583,7 +583,7 @@ 323 AUE_NULL OBSOL thr_wakeup 324 AUE_MLOCKALL NOPROTO { int mlockall(int how); } 325 AUE_MUNLOCKALL NOPROTO { int munlockall(void); } -326 AUE_GETCWD NOPROTO { int __getcwd(u_char *buf, u_int buflen); } +326 AUE_GETCWD NOPROTO { int __getcwd(char *buf, u_int buflen); } 327 AUE_NULL NOPROTO { int sched_setparam (pid_t pid, \ const struct sched_param *param); } Modified: stable/10/sys/compat/linux/linux_getcwd.c ============================================================================== --- stable/10/sys/compat/linux/linux_getcwd.c Sun Jan 11 01:49:52 2015 (r276954) +++ stable/10/sys/compat/linux/linux_getcwd.c Sun Jan 11 07:02:03 2015 (r276955) @@ -186,7 +186,7 @@ linux_getcwd_scandir(lvpp, uvpp, bpp, bu dirbuflen = DIRBLKSIZ; if (dirbuflen < va.va_blocksize) dirbuflen = va.va_blocksize; - dirbuf = (char *)malloc(dirbuflen, M_TEMP, M_WAITOK); + dirbuf = malloc(dirbuflen, M_TEMP, M_WAITOK); #if 0 unionread: @@ -413,7 +413,7 @@ out: int linux_getcwd(struct thread *td, struct linux_getcwd_args *args) { - caddr_t bp, bend, path; + char *bp, *bend, *path; int error, len, lenused; #ifdef DEBUG @@ -428,7 +428,7 @@ linux_getcwd(struct thread *td, struct l else if (len < 2) return ERANGE; - path = (char *)malloc(len, M_TEMP, M_WAITOK); + path = malloc(len, M_TEMP, M_WAITOK); error = kern___getcwd(td, path, UIO_SYSSPACE, len); if (!error) { Modified: stable/10/sys/kern/syscalls.master ============================================================================== --- stable/10/sys/kern/syscalls.master Sun Jan 11 01:49:52 2015 (r276954) +++ stable/10/sys/kern/syscalls.master Sun Jan 11 07:02:03 2015 (r276955) @@ -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); } Modified: stable/10/sys/kern/vfs_cache.c ============================================================================== --- stable/10/sys/kern/vfs_cache.c Sun Jan 11 01:49:52 2015 (r276954) +++ stable/10/sys/kern/vfs_cache.c Sun Jan 11 07:02:03 2015 (r276955) @@ -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; Modified: stable/10/sys/sys/syscallsubr.h ============================================================================== --- stable/10/sys/sys/syscallsubr.h Sun Jan 11 01:49:52 2015 (r276954) +++ stable/10/sys/sys/syscallsubr.h Sun Jan 11 07:02:03 2015 (r276955) @@ -57,7 +57,7 @@ struct stat; struct thr_param; struct __wrusage; -int kern___getcwd(struct thread *td, u_char *buf, enum uio_seg bufseg, +int kern___getcwd(struct thread *td, char *buf, enum uio_seg bufseg, u_int buflen); int kern_accept(struct thread *td, int s, struct sockaddr **name, socklen_t *namelen, struct file **fp);