[Midnightbsd-cvs] src [7241] trunk/sys: Improve *access*() paramter name consistency.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Wed Aug 12 17:54:32 EDT 2015
Revision: 7241
http://svnweb.midnightbsd.org/src/?rev=7241
Author: laffer1
Date: 2015-08-12 17:54:31 -0400 (Wed, 12 Aug 2015)
Log Message:
-----------
Improve *access*() paramter name consistency.
Code currently mixes use of flags and mode. Fix that.
Obtained from: FreeBSD revision 227691
Revision Links:
--------------
http://svnweb.midnightbsd.org/src/?rev=227691
Modified Paths:
--------------
trunk/sys/amd64/linux32/syscalls.master
trunk/sys/compat/freebsd32/syscalls.master
trunk/sys/compat/linux/linux_file.c
trunk/sys/i386/ibcs2/ibcs2_fcntl.c
trunk/sys/i386/ibcs2/syscalls.master
trunk/sys/i386/linux/syscalls.master
trunk/sys/kern/syscalls.master
trunk/sys/kern/vfs_syscalls.c
Property Changed:
----------------
trunk/sys/compat/freebsd32/syscalls.master
trunk/sys/compat/linux/linux_file.c
Modified: trunk/sys/amd64/linux32/syscalls.master
===================================================================
--- trunk/sys/amd64/linux32/syscalls.master 2015-08-12 21:48:33 UTC (rev 7240)
+++ trunk/sys/amd64/linux32/syscalls.master 2015-08-12 21:54:31 UTC (rev 7241)
@@ -86,7 +86,7 @@
struct l_utimbuf *times); }
31 AUE_NULL UNIMPL stty
32 AUE_NULL UNIMPL gtty
-33 AUE_ACCESS STD { int linux_access(char *path, l_int flags); }
+33 AUE_ACCESS STD { int linux_access(char *path, l_int amode); }
34 AUE_NICE STD { int linux_nice(l_int inc); }
35 AUE_NULL UNIMPL ftime
36 AUE_SYNC NOPROTO { int sync(void); }
@@ -503,7 +503,7 @@
char *buf, l_int bufsiz); }
306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \
l_mode_t mode); }
-307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int mode); }
+307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode); }
308 AUE_NULL STD { int linux_pselect6(void); }
309 AUE_NULL STD { int linux_ppoll(void); }
310 AUE_NULL STD { int linux_unshare(void); }
Modified: trunk/sys/compat/freebsd32/syscalls.master
===================================================================
--- trunk/sys/compat/freebsd32/syscalls.master 2015-08-12 21:48:33 UTC (rev 7240)
+++ trunk/sys/compat/freebsd32/syscalls.master 2015-08-12 21:54:31 UTC (rev 7241)
@@ -113,7 +113,7 @@
int *alen); }
32 AUE_GETSOCKNAME NOPROTO { int getsockname(int fdes, caddr_t asa, \
int *alen); }
-33 AUE_ACCESS NOPROTO { int access(char *path, int flags); }
+33 AUE_ACCESS NOPROTO { int access(char *path, int amode); }
34 AUE_CHFLAGS NOPROTO { int chflags(char *path, int flags); }
35 AUE_FCHFLAGS NOPROTO { int fchflags(int fd, int flags); }
36 AUE_SYNC NOPROTO { int sync(void); }
@@ -671,7 +671,7 @@
const char *attrname); }
374 AUE_NULL NOPROTO { int __setugid(int flag); }
375 AUE_NULL UNIMPL nfsclnt
-376 AUE_EACCESS NOPROTO { int eaccess(char *path, int flags); }
+376 AUE_EACCESS NOPROTO { int eaccess(char *path, int amode); }
377 AUE_NULL UNIMPL afs_syscall
378 AUE_NMOUNT STD { int freebsd32_nmount(struct iovec32 *iovp, \
unsigned int iovcnt, int flags); }
@@ -911,7 +911,7 @@
u_int32_t id1, u_int32_t id2, \
size_t cpusetsize, \
const cpuset_t *mask); }
-489 AUE_FACCESSAT NOPROTO { int faccessat(int fd, char *path, int mode, \
+489 AUE_FACCESSAT NOPROTO { int faccessat(int fd, char *path, int amode, \
int flag); }
490 AUE_FCHMODAT NOPROTO { int fchmodat(int fd, const char *path, \
mode_t mode, int flag); }
Property changes on: trunk/sys/compat/freebsd32/syscalls.master
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.7
\ No newline at end of property
Modified: trunk/sys/compat/linux/linux_file.c
===================================================================
--- trunk/sys/compat/linux/linux_file.c 2015-08-12 21:48:33 UTC (rev 7240)
+++ trunk/sys/compat/linux/linux_file.c 2015-08-12 21:54:31 UTC (rev 7241)
@@ -565,7 +565,7 @@
int error;
/* linux convention */
- if (args->flags & ~(F_OK | X_OK | W_OK | R_OK))
+ if (args->amode & ~(F_OK | X_OK | W_OK | R_OK))
return (EINVAL);
LCONVPATHEXIST(td, args->path, &path);
@@ -572,9 +572,9 @@
#ifdef DEBUG
if (ldebug(access))
- printf(ARGS(access, "%s, %d"), path, args->flags);
+ printf(ARGS(access, "%s, %d"), path, args->amode);
#endif
- error = kern_access(td, path, UIO_SYSSPACE, args->flags);
+ error = kern_access(td, path, UIO_SYSSPACE, args->amode);
LFREEPATH(path);
return (error);
@@ -587,7 +587,7 @@
int error, dfd;
/* linux convention */
- if (args->mode & ~(F_OK | X_OK | W_OK | R_OK))
+ if (args->amode & ~(F_OK | X_OK | W_OK | R_OK))
return (EINVAL);
dfd = (args->dfd == LINUX_AT_FDCWD) ? AT_FDCWD : args->dfd;
@@ -595,11 +595,11 @@
#ifdef DEBUG
if (ldebug(access))
- printf(ARGS(access, "%s, %d"), path, args->mode);
+ printf(ARGS(access, "%s, %d"), path, args->amode);
#endif
error = kern_accessat(td, dfd, path, UIO_SYSSPACE, 0 /* XXX */,
- args->mode);
+ args->amode);
LFREEPATH(path);
return (error);
Property changes on: trunk/sys/compat/linux/linux_file.c
___________________________________________________________________
Deleted: cvs2svn:cvs-rev
## -1 +0,0 ##
-1.4
\ No newline at end of property
Modified: trunk/sys/i386/ibcs2/ibcs2_fcntl.c
===================================================================
--- trunk/sys/i386/ibcs2/ibcs2_fcntl.c 2015-08-12 21:48:33 UTC (rev 7240)
+++ trunk/sys/i386/ibcs2/ibcs2_fcntl.c 2015-08-12 21:54:31 UTC (rev 7241)
@@ -243,7 +243,7 @@
int error;
CHECKALTEXIST(td, uap->path, &path);
- error = kern_access(td, path, UIO_SYSSPACE, uap->flags);
+ error = kern_access(td, path, UIO_SYSSPACE, uap->amode);
free(path, M_TEMP);
return (error);
}
Modified: trunk/sys/i386/ibcs2/syscalls.master
===================================================================
--- trunk/sys/i386/ibcs2/syscalls.master 2015-08-12 21:48:33 UTC (rev 7240)
+++ trunk/sys/i386/ibcs2/syscalls.master 2015-08-12 21:54:31 UTC (rev 7241)
@@ -80,7 +80,7 @@
struct ibcs2_utimbuf *buf); }
31 AUE_NULL UNIMPL ibcs2_stty
32 AUE_NULL UNIMPL ibcs2_gtty
-33 AUE_ACCESS STD { int ibcs2_access(char *path, int flags); }
+33 AUE_ACCESS STD { int ibcs2_access(char *path, int amode); }
34 AUE_NICE STD { int ibcs2_nice(int incr); }
35 AUE_STATFS STD { int ibcs2_statfs(char *path, \
struct ibcs2_statfs *buf, int len, \
Modified: trunk/sys/i386/linux/syscalls.master
===================================================================
--- trunk/sys/i386/linux/syscalls.master 2015-08-12 21:48:33 UTC (rev 7240)
+++ trunk/sys/i386/linux/syscalls.master 2015-08-12 21:54:31 UTC (rev 7241)
@@ -86,7 +86,7 @@
struct l_utimbuf *times); }
31 AUE_NULL UNIMPL stty
32 AUE_NULL UNIMPL gtty
-33 AUE_ACCESS STD { int linux_access(char *path, l_int flags); }
+33 AUE_ACCESS STD { int linux_access(char *path, l_int amode); }
34 AUE_NICE STD { int linux_nice(l_int inc); }
35 AUE_NULL UNIMPL ftime
36 AUE_SYNC NOPROTO { int sync(void); }
@@ -513,7 +513,7 @@
char *buf, l_int bufsiz); }
306 AUE_FCHMODAT STD { int linux_fchmodat(l_int dfd, const char *filename, \
l_mode_t mode); }
-307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int mode); }
+307 AUE_FACCESSAT STD { int linux_faccessat(l_int dfd, const char *filename, l_int amode); }
308 AUE_NULL STD { int linux_pselect6(void); }
309 AUE_NULL STD { int linux_ppoll(void); }
310 AUE_NULL STD { int linux_unshare(void); }
Modified: trunk/sys/kern/syscalls.master
===================================================================
--- trunk/sys/kern/syscalls.master 2015-08-12 21:48:33 UTC (rev 7240)
+++ trunk/sys/kern/syscalls.master 2015-08-12 21:54:31 UTC (rev 7241)
@@ -115,7 +115,7 @@
32 AUE_GETSOCKNAME STD { int getsockname(int fdes, \
struct sockaddr * __restrict asa, \
__socklen_t * __restrict alen); }
-33 AUE_ACCESS STD { int access(char *path, int flags); }
+33 AUE_ACCESS STD { int access(char *path, int amode); }
34 AUE_CHFLAGS STD { int chflags(char *path, int flags); }
35 AUE_FCHFLAGS STD { int fchflags(int fd, int flags); }
36 AUE_SYNC STD { int sync(void); }
@@ -671,7 +671,7 @@
const char *attrname); }
374 AUE_NULL STD { int __setugid(int flag); }
375 AUE_NULL UNIMPL nfsclnt
-376 AUE_EACCESS STD { int eaccess(char *path, int flags); }
+376 AUE_EACCESS STD { int eaccess(char *path, int amode); }
377 AUE_NULL NOSTD|NOTSTATIC { int afs3_syscall(long syscall, \
long parm1, long parm2, long parm3, \
long parm4, long parm5, long parm6); }
@@ -870,7 +870,7 @@
488 AUE_NULL STD { int cpuset_setaffinity(cpulevel_t level, \
cpuwhich_t which, id_t id, size_t cpusetsize, \
const cpuset_t *mask); }
-489 AUE_FACCESSAT STD { int faccessat(int fd, char *path, int mode, \
+489 AUE_FACCESSAT STD { int faccessat(int fd, char *path, int amode, \
int flag); }
490 AUE_FCHMODAT STD { int fchmodat(int fd, char *path, mode_t mode, \
int flag); }
Modified: trunk/sys/kern/vfs_syscalls.c
===================================================================
--- trunk/sys/kern/vfs_syscalls.c 2015-08-12 21:48:33 UTC (rev 7240)
+++ trunk/sys/kern/vfs_syscalls.c 2015-08-12 21:54:31 UTC (rev 7241)
@@ -2152,7 +2152,7 @@
#ifndef _SYS_SYSPROTO_H_
struct access_args {
char *path;
- int flags;
+ int amode;
};
#endif
int
@@ -2160,11 +2160,11 @@
struct thread *td;
register struct access_args /* {
char *path;
- int flags;
+ int amode;
} */ *uap;
{
- return (kern_access(td, uap->path, UIO_USERSPACE, uap->flags));
+ return (kern_access(td, uap->path, UIO_USERSPACE, uap->amode));
}
#ifndef _SYS_SYSPROTO_H_
@@ -2171,7 +2171,7 @@
struct faccessat_args {
int dirfd;
char *path;
- int mode;
+ int amode;
int flag;
}
#endif
@@ -2182,19 +2182,19 @@
if (uap->flag & ~AT_EACCESS)
return (EINVAL);
return (kern_accessat(td, uap->fd, uap->path, UIO_USERSPACE, uap->flag,
- uap->mode));
+ uap->amode));
}
int
-kern_access(struct thread *td, char *path, enum uio_seg pathseg, int mode)
+kern_access(struct thread *td, char *path, enum uio_seg pathseg, int amode)
{
- return (kern_accessat(td, AT_FDCWD, path, pathseg, 0, mode));
+ return (kern_accessat(td, AT_FDCWD, path, pathseg, 0, amode));
}
int
kern_accessat(struct thread *td, int fd, char *path, enum uio_seg pathseg,
- int flags, int mode)
+ int flag, int amode)
{
struct ucred *cred, *tmpcred;
struct vnode *vp;
@@ -2206,7 +2206,7 @@
* Create and modify a temporary credential instead of one that
* is potentially shared.
*/
- if (!(flags & AT_EACCESS)) {
+ if (!(flag & AT_EACCESS)) {
cred = td->td_ucred;
tmpcred = crdup(cred);
tmpcred->cr_uid = cred->cr_ruid;
@@ -2214,7 +2214,7 @@
td->td_ucred = tmpcred;
} else
cred = tmpcred = td->td_ucred;
- AUDIT_ARG_VALUE(mode);
+ AUDIT_ARG_VALUE(amode);
NDINIT_ATRIGHTS(&nd, LOOKUP, FOLLOW | LOCKSHARED | LOCKLEAF | MPSAFE |
AUDITVNODE1, pathseg, path, fd, CAP_FSTAT, td);
if ((error = namei(&nd)) != 0)
@@ -2222,12 +2222,12 @@
vfslocked = NDHASGIANT(&nd);
vp = nd.ni_vp;
- error = vn_access(vp, mode, tmpcred, td);
+ error = vn_access(vp, amode, tmpcred, td);
NDFREE(&nd, NDF_ONLY_PNBUF);
vput(vp);
VFS_UNLOCK_GIANT(vfslocked);
out1:
- if (!(flags & AT_EACCESS)) {
+ if (!(flag & AT_EACCESS)) {
td->td_ucred = cred;
crfree(tmpcred);
}
@@ -2240,7 +2240,7 @@
#ifndef _SYS_SYSPROTO_H_
struct eaccess_args {
char *path;
- int flags;
+ int amode;
};
#endif
int
@@ -2248,18 +2248,18 @@
struct thread *td;
register struct eaccess_args /* {
char *path;
- int flags;
+ int amode;
} */ *uap;
{
- return (kern_eaccess(td, uap->path, UIO_USERSPACE, uap->flags));
+ return (kern_eaccess(td, uap->path, UIO_USERSPACE, uap->amode));
}
int
-kern_eaccess(struct thread *td, char *path, enum uio_seg pathseg, int flags)
+kern_eaccess(struct thread *td, char *path, enum uio_seg pathseg, int amode)
{
- return (kern_accessat(td, AT_FDCWD, path, pathseg, AT_EACCESS, flags));
+ return (kern_accessat(td, AT_FDCWD, path, pathseg, AT_EACCESS, amode));
}
#if defined(COMPAT_43)
More information about the Midnightbsd-cvs
mailing list