summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-05 04:35:15 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-05 04:35:15 +0000
commit90d91e3c8f964eb5eebe829f76b8c6143d395a5e (patch)
treed6efec243db3618b2a7fc12b1f2e3d07e972f1ba /sys/compat
parentb71266f31dfafe8f3e5d070002f8723933b73b70 (diff)
fix F_GETLK; tron@lyssa.owl.de
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_file.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c
index 4ebcd245402..f9cd60daa09 100644
--- a/sys/compat/linux/linux_file.c
+++ b/sys/compat/linux/linux_file.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_file.c,v 1.7 1997/07/27 21:01:36 deraadt Exp $ */
+/* $OpenBSD: linux_file.c,v 1.8 1997/09/05 04:35:14 deraadt Exp $ */
/* $NetBSD: linux_file.c,v 1.15 1996/05/20 01:59:09 fvdl Exp $ */
/*
@@ -346,16 +346,22 @@ linux_sys_fcntl(p, v, retval)
return sys_fcntl(p, &fca, retval);
case LINUX_F_GETLK:
sg = stackgap_init(p->p_emul);
+ if ((error = copyin(arg, &lfl, sizeof lfl)))
+ return error;
+ linux_to_bsd_flock(&lfl, &bfl);
bfp = (struct flock *) stackgap_alloc(&sg, sizeof *bfp);
SCARG(&fca, fd) = fd;
SCARG(&fca, cmd) = F_GETLK;
SCARG(&fca, arg) = bfp;
+ if ((error = copyout(&bfl, bfp, sizeof bfl)))
+ return error;
if ((error = sys_fcntl(p, &fca, retval)))
return error;
if ((error = copyin(bfp, &bfl, sizeof bfl)))
return error;
bsd_to_linux_flock(&bfl, &lfl);
- return copyout(&lfl, arg, sizeof lfl);
+ error = copyout(&lfl, arg, sizeof lfl);
+ return error;
break;
case LINUX_F_SETLK:
case LINUX_F_SETLKW: