diff options
author | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-10-30 16:37:21 +0000 |
---|---|---|
committer | Niklas Hallqvist <niklas@cvs.openbsd.org> | 1996-10-30 16:37:21 +0000 |
commit | ae8ef4e6f9b691bbd8786a3242b8bbf3afe28f0a (patch) | |
tree | 832e44cb70904f75728062757a14c7980276de85 /sys | |
parent | d1918a04999db403b18d9a2070a31b9f85b52bea (diff) |
More -Wall happiness
Diffstat (limited to 'sys')
-rw-r--r-- | sys/compat/osf1/osf1_misc.c | 40 | ||||
-rw-r--r-- | sys/compat/osf1/osf1_mount.c | 38 |
2 files changed, 49 insertions, 29 deletions
diff --git a/sys/compat/osf1/osf1_misc.c b/sys/compat/osf1/osf1_misc.c index bd611b4407c..f19e0594ea8 100644 --- a/sys/compat/osf1/osf1_misc.c +++ b/sys/compat/osf1/osf1_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: osf1_misc.c,v 1.7 1996/10/17 19:15:49 niklas Exp $ */ +/* $OpenBSD: osf1_misc.c,v 1.8 1996/10/30 16:37:19 niklas Exp $ */ /* $NetBSD: osf1_misc.c,v 1.7 1995/10/07 06:53:04 mycroft Exp $ */ /* @@ -41,8 +41,10 @@ #include <sys/mount.h> #include <sys/signal.h> #include <sys/signalvar.h> +#include <sys/socketvar.h> #include <sys/reboot.h> #include <sys/syscallargs.h> +#include <sys/vnode.h> #include <compat/osf1/osf1_syscall.h> #include <compat/osf1/osf1_syscallargs.h> @@ -61,6 +63,8 @@ extern void cpu_exec_ecoff_setregs __P((struct proc *, struct exec_package *, extern char sigcode[], esigcode[]; +void cvtstat2osf1 __P((struct stat *, struct osf1_stat *)); + struct emul emul_osf1 = { "osf1", NULL, @@ -114,6 +118,7 @@ osf1_sys_setsysinfo(p, v, retval) void *v; register_t *retval; { +#if 0 struct osf1_setsysinfo_args /* { syscallarg(u_long) op; syscallarg(caddr_t) buffer; @@ -121,6 +126,7 @@ osf1_sys_setsysinfo(p, v, retval) syscallarg(caddr_t) arg; syscallarg(u_long) flag; } */ *uap = v; +#endif; return (0); } @@ -129,6 +135,7 @@ osf1_sys_setsysinfo(p, v, retval) #define OSF1_RLIMIT_NOFILE 6 /* OSF1's RLIMIT_NOFILE */ #define OSF1_RLIMIT_NLIMITS 8 /* Number of OSF1 rlimits */ +int osf1_sys_getrlimit(p, v, retval) struct proc *p; void *v; @@ -157,6 +164,7 @@ osf1_sys_getrlimit(p, v, retval) return sys_getrlimit(p, &a, retval); } +int osf1_sys_setrlimit(p, v, retval) struct proc *p; void *v; @@ -267,7 +275,7 @@ osf1_sys_usleep_thread(p, v, retval) u_long ticks; int error, s; - if (error = copyin(SCARG(uap, sleep), &tv, sizeof tv)) + if ((error = copyin(SCARG(uap, sleep), &tv, sizeof tv)) != 0) return (error); ticks = ((u_long)tv.tv_sec * 1000000 + tv.tv_usec) / tick; @@ -314,6 +322,7 @@ struct osf1_stat { * Get file status; this version follows links. */ /* ARGSUSED */ +int osf1_sys_stat(p, v, retval) struct proc *p; void *v; @@ -330,7 +339,7 @@ osf1_sys_stat(p, v, retval) NDINIT(&nd, LOOKUP, FOLLOW | LOCKLEAF, UIO_USERSPACE, SCARG(uap, path), p); - if (error = namei(&nd)) + if ((error = namei(&nd)) != 0) return (error); error = vn_stat(nd.ni_vp, &sb, p); vput(nd.ni_vp); @@ -345,6 +354,7 @@ osf1_sys_stat(p, v, retval) * Get file status; this version does not follow links. */ /* ARGSUSED */ +int osf1_sys_lstat(p, v, retval) struct proc *p; void *v; @@ -361,7 +371,7 @@ osf1_sys_lstat(p, v, retval) NDINIT(&nd, LOOKUP, NOFOLLOW | LOCKLEAF, UIO_USERSPACE, SCARG(uap, path), p); - if (error = namei(&nd)) + if ((error = namei(&nd)) != 0) return (error); error = vn_stat(nd.ni_vp, &sb, p); vput(nd.ni_vp); @@ -375,6 +385,7 @@ osf1_sys_lstat(p, v, retval) /* * Return status information about a file descriptor. */ +int osf1_sys_fstat(p, v, retval) struct proc *p; void *v; @@ -420,6 +431,7 @@ osf1_sys_fstat(p, v, retval) /* * Convert from a stat structure to an osf1 stat structure. */ +void cvtstat2osf1(st, ost) struct stat *st; struct osf1_stat *ost; @@ -799,8 +811,8 @@ osf1_sys_readv(p, v, retval) M_TEMP, M_WAITOK); error = 0; - if (error = copyin(SCARG(uap, iovp), oio, - SCARG(uap, iovcnt) * sizeof (struct osf1_iovec))) + if ((error = copyin(SCARG(uap, iovp), oio, + SCARG(uap, iovcnt) * sizeof (struct osf1_iovec))) != 0) goto punt; for (i = 0; i < SCARG(uap, iovcnt); i++) { nio[i].iov_base = oio[i].iov_base; @@ -811,8 +823,8 @@ osf1_sys_readv(p, v, retval) SCARG(&a, iovp) = (struct iovec *)STACKGAPBASE; SCARG(&a, iovcnt) = SCARG(uap, iovcnt); - if (error = copyout(nio, (caddr_t)SCARG(&a, iovp), - SCARG(uap, iovcnt) * sizeof (struct iovec))) + if ((error = copyout(nio, (caddr_t)SCARG(&a, iovp), + SCARG(uap, iovcnt) * sizeof (struct iovec))) != 0) goto punt; error = sys_readv(p, &a, retval); @@ -854,8 +866,8 @@ osf1_sys_writev(p, v, retval) M_TEMP, M_WAITOK); error = 0; - if (error = copyin(SCARG(uap, iovp), oio, - SCARG(uap, iovcnt) * sizeof (struct osf1_iovec))) + if ((error = copyin(SCARG(uap, iovp), oio, + SCARG(uap, iovcnt) * sizeof (struct osf1_iovec))) != 0) goto punt; for (i = 0; i < SCARG(uap, iovcnt); i++) { nio[i].iov_base = oio[i].iov_base; @@ -866,8 +878,8 @@ osf1_sys_writev(p, v, retval) SCARG(&a, iovp) = (struct iovec *)STACKGAPBASE; SCARG(&a, iovcnt) = SCARG(uap, iovcnt); - if (error = copyout(nio, (caddr_t)SCARG(&a, iovp), - SCARG(uap, iovcnt) * sizeof (struct iovec))) + if ((error = copyout(nio, (caddr_t)SCARG(&a, iovp), + SCARG(uap, iovcnt) * sizeof (struct iovec))) != 0) goto punt; error = sys_writev(p, &a, retval); @@ -965,9 +977,9 @@ osf1_sys_execve(p, v, retval) register_t *retval; { struct osf1_sys_execve_args *uap = v; - - caddr_t sg = stackgap_init(p->p_emul); #if 0 + caddr_t sg = stackgap_init(p->p_emul); + OSF1_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); #endif diff --git a/sys/compat/osf1/osf1_mount.c b/sys/compat/osf1/osf1_mount.c index 3a86076a5d1..a591c6014ab 100644 --- a/sys/compat/osf1/osf1_mount.c +++ b/sys/compat/osf1/osf1_mount.c @@ -1,4 +1,4 @@ -/* $OpenBSD: osf1_mount.c,v 1.3 1996/08/23 11:48:48 niklas Exp $ */ +/* $OpenBSD: osf1_mount.c,v 1.4 1996/10/30 16:37:20 niklas Exp $ */ /* $NetBSD: osf1_mount.c,v 1.6 1996/02/17 23:08:36 jtk Exp $ */ /* @@ -155,6 +155,12 @@ struct osf1_nfs_args { OSF1_NFSMNT_TIMEO|OSF1_NFSMNT_RETRANS|OSF1_NFSMNT_HOSTNAME| \ OSF1_NFSMNT_INT|OSF1_NFSMNT_NOCONN) +void bsd2osf_statfs __P((struct statfs *, struct osf1_statfs *)); +int osf1_mount_mfs __P((struct proc *, struct osf1_sys_mount_args *, + struct sys_mount_args *)); +int osf1_mount_nfs __P((struct proc *, struct osf1_sys_mount_args *, + struct sys_mount_args *)); + void bsd2osf_statfs(bsfs, osfs) struct statfs *bsfs; @@ -207,12 +213,12 @@ osf1_sys_statfs(p, v, retval) struct nameidata nd; NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p); - if (error = namei(&nd)) + if ((error = namei(&nd)) != 0) return (error); mp = nd.ni_vp->v_mount; sp = &mp->mnt_stat; vrele(nd.ni_vp); - if (error = VFS_STATFS(mp, sp, p)) + if ((error = VFS_STATFS(mp, sp, p)) != 0) return (error); sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; bsd2osf_statfs(sp, &osfs); @@ -237,11 +243,11 @@ osf1_sys_fstatfs(p, v, retval) struct osf1_statfs osfs; int error; - if (error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) + if ((error = getvnode(p->p_fd, SCARG(uap, fd), &fp)) != 0) return (error); mp = ((struct vnode *)fp->f_data)->v_mount; sp = &mp->mnt_stat; - if (error = VFS_STATFS(mp, sp, p)) + if ((error = VFS_STATFS(mp, sp, p)) != 0) return (error); sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; bsd2osf_statfs(sp, &osfs); @@ -288,8 +294,8 @@ osf1_sys_getfsstat(p, v, retval) continue; sp->f_flags = mp->mnt_flag & MNT_VISFLAGMASK; bsd2osf_statfs(sp, &osfs); - if (error = copyout(&osfs, osf_sfsp, - sizeof (struct osf1_statfs))) + if ((error = copyout(&osfs, osf_sfsp, + sizeof (struct osf1_statfs))) != 0) return (error); osf_sfsp += sizeof (struct osf1_statfs); } @@ -353,12 +359,12 @@ osf1_sys_mount(p, v, retval) break; case OSF1_MOUNT_NFS: /* XXX */ - if (error = osf1_mount_nfs(p, uap, &a)) + if ((error = osf1_mount_nfs(p, uap, &a)) != 0) return error; break; case OSF1_MOUNT_MFS: /* XXX */ - if (error = osf1_mount_mfs(p, uap, &a)) + if ((error = osf1_mount_mfs(p, uap, &a)) != 0) return error; break; @@ -398,7 +404,8 @@ osf1_mount_mfs(p, osf_argp, bsd_argp) caddr_t cp; int error; - if (error = copyin(SCARG(osf_argp, data), &osf_ma, sizeof osf_ma)) + error = copyin(SCARG(osf_argp, data), &osf_ma, sizeof osf_ma); + if (error) return error; bzero(&bsd_ma, sizeof bsd_ma); @@ -409,12 +416,12 @@ osf1_mount_mfs(p, osf_argp, bsd_argp) cp = STACKGAPBASE; SCARG(bsd_argp, data) = cp; - if (error = copyout(&bsd_ma, cp, sizeof bsd_ma)) + if ((error = copyout(&bsd_ma, cp, sizeof bsd_ma)) != 0) return error; cp += ALIGN(sizeof bsd_ma); SCARG(bsd_argp, type) = cp; - if (error = copyout(MOUNT_MFS, cp, strlen(MOUNT_MFS) + 1)) + if ((error = copyout(MOUNT_MFS, cp, strlen(MOUNT_MFS) + 1)) != 0) return error; return 0; @@ -432,7 +439,8 @@ osf1_mount_nfs(p, osf_argp, bsd_argp) caddr_t cp; int error; - if (error = copyin(SCARG(osf_argp, data), &osf_na, sizeof osf_na)) + error = copyin(SCARG(osf_argp, data), &osf_na, sizeof osf_na); + if (error) return error; bzero(&bsd_na, sizeof bsd_na); @@ -472,12 +480,12 @@ osf1_mount_nfs(p, osf_argp, bsd_argp) cp = STACKGAPBASE; SCARG(bsd_argp, data) = cp; - if (error = copyout(&bsd_na, cp, sizeof bsd_na)) + if ((error = copyout(&bsd_na, cp, sizeof bsd_na)) != 0) return error; cp += ALIGN(sizeof bsd_na); SCARG(bsd_argp, type) = cp; - if (error = copyout(MOUNT_NFS, cp, strlen(MOUNT_NFS) + 1)) + if ((error = copyout(MOUNT_NFS, cp, strlen(MOUNT_NFS) + 1)) != 0) return error; return 0; |