aboutsummaryrefslogtreecommitdiff
path: root/sys/i386/linux
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>1999-05-06 18:44:42 +0000
committerPeter Wemm <peter@FreeBSD.org>1999-05-06 18:44:42 +0000
commitd5558c001a19cfd5853f6d7ec29ff06e59cc505e (patch)
treee66173b9fca9928c8edc1d91bff2929f2d2b1ae5 /sys/i386/linux
parent522c197d02fdb39228b2097a70e7f3d868a47a4c (diff)
Notes
Diffstat (limited to 'sys/i386/linux')
-rw-r--r--sys/i386/linux/linux_file.c5
-rw-r--r--sys/i386/linux/linux_ioctl.c5
-rw-r--r--sys/i386/linux/linux_misc.c20
-rw-r--r--sys/i386/linux/linux_signal.c23
-rw-r--r--sys/i386/linux/linux_stats.c14
5 files changed, 43 insertions, 24 deletions
diff --git a/sys/i386/linux/linux_file.c b/sys/i386/linux/linux_file.c
index 16f12ed4d7bea..907e6b8bba004 100644
--- a/sys/i386/linux/linux_file.c
+++ b/sys/i386/linux/linux_file.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_file.c,v 1.22 1998/10/05 16:37:36 jfieber Exp $
+ * $Id: linux_file.c,v 1.23 1999/01/10 23:15:35 eivind Exp $
*/
#include "opt_compat.h"
@@ -258,7 +258,8 @@ linux_fcntl(struct proc *p, struct linux_fcntl_args *args)
linux_to_bsd_flock(&linux_flock, bsd_flock);
fcntl_args.cmd = F_GETLK;
fcntl_args.arg = (int)bsd_flock;
- if (error = fcntl(p, &fcntl_args))
+ error = fcntl(p, &fcntl_args);
+ if (error)
return error;
bsd_to_linux_flock(bsd_flock, &linux_flock);
return copyout((caddr_t)&linux_flock, (caddr_t)args->arg,
diff --git a/sys/i386/linux/linux_ioctl.c b/sys/i386/linux/linux_ioctl.c
index 9af33a997e343..3b4efd95dac93 100644
--- a/sys/i386/linux/linux_ioctl.c
+++ b/sys/i386/linux/linux_ioctl.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_ioctl.c,v 1.30 1998/11/12 00:42:08 jkh Exp $
+ * $Id: linux_ioctl.c,v 1.31 1999/04/29 04:37:57 luoqi Exp $
*/
#include <sys/param.h>
@@ -732,7 +732,8 @@ linux_ioctl(struct proc *p, struct linux_ioctl_args *args)
case LINUX_TIOCGETD:
bsd_line = TTYDISC;
- if (error =(*func)(fp, TIOCSETD, (caddr_t)&bsd_line, p))
+ error =(*func)(fp, TIOCSETD, (caddr_t)&bsd_line, p);
+ if (error)
return error;
switch (bsd_line) {
case TTYDISC:
diff --git a/sys/i386/linux/linux_misc.c b/sys/i386/linux/linux_misc.c
index e01693ad0aefa..9976e641ed4b2 100644
--- a/sys/i386/linux/linux_misc.c
+++ b/sys/i386/linux/linux_misc.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_misc.c,v 1.56 1999/04/27 12:21:04 phk Exp $
+ * $Id: linux_misc.c,v 1.57 1999/04/28 01:04:19 luoqi Exp $
*/
#include <sys/param.h>
@@ -173,7 +173,8 @@ linux_uselib(struct proc *p, struct linux_uselib_args *args)
vp = NULL;
NDINIT(&ni, LOOKUP, FOLLOW | LOCKLEAF, UIO_SYSSPACE, args->library, p);
- if (error = namei(&ni))
+ error = namei(&ni);
+ if (error)
goto cleanup;
vp = ni.ni_vp;
@@ -198,7 +199,8 @@ linux_uselib(struct proc *p, struct linux_uselib_args *args)
/*
* Executable?
*/
- if (error = VOP_GETATTR(vp, &attr, p->p_ucred, p))
+ error = VOP_GETATTR(vp, &attr, p->p_ucred, p);
+ if (error)
goto cleanup;
if ((vp->v_mount->mnt_flag & MNT_NOEXEC) ||
@@ -219,10 +221,12 @@ linux_uselib(struct proc *p, struct linux_uselib_args *args)
/*
* Can we access it?
*/
- if (error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p))
+ error = VOP_ACCESS(vp, VEXEC, p->p_ucred, p);
+ if (error)
goto cleanup;
- if (error = VOP_OPEN(vp, FREAD, p->p_ucred, p))
+ error = VOP_OPEN(vp, FREAD, p->p_ucred, p);
+ if (error)
goto cleanup;
/*
@@ -772,12 +776,14 @@ linux_pipe(struct proc *p, struct linux_pipe_args *args)
printf("Linux-emul(%d): pipe(*)\n", p->p_pid);
#endif
reg_edx = p->p_retval[1];
- if (error = pipe(p, 0)) {
+ error = pipe(p, 0);
+ if (error) {
p->p_retval[1] = reg_edx;
return error;
}
- if (error = copyout(p->p_retval, args->pipefds, 2*sizeof(int))) {
+ error = copyout(p->p_retval, args->pipefds, 2*sizeof(int));
+ if (error) {
p->p_retval[1] = reg_edx;
return error;
}
diff --git a/sys/i386/linux/linux_signal.c b/sys/i386/linux/linux_signal.c
index 1f71bf53df09b..c8f0f210c6313 100644
--- a/sys/i386/linux/linux_signal.c
+++ b/sys/i386/linux/linux_signal.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_signal.c,v 1.13 1998/10/11 04:54:16 jdp Exp $
+ * $Id: linux_signal.c,v 1.14 1998/12/21 19:21:36 sos Exp $
*/
#include <sys/param.h>
@@ -123,23 +123,28 @@ linux_sigaction(struct proc *p, struct linux_sigaction_args *args)
if (args->nsa) {
nsa = (struct sigaction *)stackgap_alloc(&sg, sizeof(struct sigaction));
- if (error = copyin(args->nsa, &linux_sa, sizeof(linux_sigaction_t)))
+ error = copyin(args->nsa, &linux_sa, sizeof(linux_sigaction_t));
+ if (error)
return error;
linux_to_bsd_sigaction(&linux_sa, &bsd_sa);
- if (error = copyout(&bsd_sa, nsa, sizeof(struct sigaction)))
+ error = copyout(&bsd_sa, nsa, sizeof(struct sigaction));
+ if (error)
return error;
}
sa.signum = linux_to_bsd_signal[args->sig];
sa.nsa = nsa;
sa.osa = osa;
- if ((error = sigaction(p, &sa)))
+ error = sigaction(p, &sa);
+ if (error)
return error;
if (args->osa) {
- if (error = copyin(osa, &bsd_sa, sizeof(struct sigaction)))
+ error = copyin(osa, &bsd_sa, sizeof(struct sigaction));
+ if (error)
return error;
bsd_to_linux_sigaction(&bsd_sa, &linux_sa);
- if (error = copyout(&linux_sa, args->osa, sizeof(linux_sigaction_t)))
+ error = copyout(&linux_sa, args->osa, sizeof(linux_sigaction_t));
+ if (error)
return error;
}
return 0;
@@ -199,12 +204,14 @@ linux_sigprocmask(struct proc *p, struct linux_sigprocmask_args *args)
if (args->omask != NULL) {
omask = bsd_to_linux_sigset(p->p_sigmask);
- if (error = copyout(&omask, args->omask, sizeof(sigset_t)))
+ error = copyout(&omask, args->omask, sizeof(sigset_t));
+ if (error)
return error;
}
if (!(args->mask))
return 0;
- if (error = copyin(args->mask, &mask, sizeof(linux_sigset_t)))
+ error = copyin(args->mask, &mask, sizeof(linux_sigset_t));
+ if (error)
return error;
mask = linux_to_bsd_sigset(mask);
diff --git a/sys/i386/linux/linux_stats.c b/sys/i386/linux/linux_stats.c
index 3606e20f9cb74..dc9090bfcfce2 100644
--- a/sys/i386/linux/linux_stats.c
+++ b/sys/i386/linux/linux_stats.c
@@ -25,7 +25,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: linux_stats.c,v 1.8 1997/02/22 09:38:25 peter Exp $
+ * $Id: linux_stats.c,v 1.9 1997/11/06 19:29:04 phk Exp $
*/
#include <sys/param.h>
@@ -241,12 +241,14 @@ linux_statfs(struct proc *p, struct linux_statfs_args *args)
#endif
ndp = &nd;
NDINIT(ndp, LOOKUP, FOLLOW, UIO_USERSPACE, args->path, curproc);
- if (error = namei(ndp))
+ error = namei(ndp);
+ if (error)
return error;
mp = ndp->ni_vp->v_mount;
bsd_statfs = &mp->mnt_stat;
vrele(ndp->ni_vp);
- if (error = VFS_STATFS(mp, bsd_statfs, p))
+ error = VFS_STATFS(mp, bsd_statfs, p);
+ if (error)
return error;
bsd_statfs->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
linux_statfs_buf.ftype = bsd_statfs->f_type;
@@ -275,11 +277,13 @@ linux_fstatfs(struct proc *p, struct linux_fstatfs_args *args)
#ifdef DEBUG
printf("Linux-emul(%d): fstatfs(%d, *)\n", p->p_pid, args->fd);
#endif
- if (error = getvnode(p->p_fd, args->fd, &fp))
+ error = getvnode(p->p_fd, args->fd, &fp);
+ if (error)
return error;
mp = ((struct vnode *)fp->f_data)->v_mount;
bsd_statfs = &mp->mnt_stat;
- if (error = VFS_STATFS(mp, bsd_statfs, p))
+ error = VFS_STATFS(mp, bsd_statfs, p);
+ if (error)
return error;
bsd_statfs->f_flags = mp->mnt_flag & MNT_VISFLAGMASK;
linux_statfs_buf.ftype = bsd_statfs->f_type;