diff options
author | Eric Jackson <ericj@cvs.openbsd.org> | 2000-09-07 17:52:25 +0000 |
---|---|---|
committer | Eric Jackson <ericj@cvs.openbsd.org> | 2000-09-07 17:52:25 +0000 |
commit | 5514f7f20355848f9c876f7197bfba9e4b88c76e (patch) | |
tree | 6bf13c6ca958971efa5f1d14480c2712140a607e | |
parent | 4f5c276138747ef97183ba337c8f6655dae25e8b (diff) |
common/compat_util.c
-rw-r--r-- | sys/compat/hpux/hpux_file.c | 4 | ||||
-rw-r--r-- | sys/compat/ibcs2/ibcs2_misc.c | 4 | ||||
-rw-r--r-- | sys/compat/ibcs2/ibcs2_stat.c | 8 | ||||
-rw-r--r-- | sys/compat/linux/linux_file.c | 4 | ||||
-rw-r--r-- | sys/compat/linux/linux_misc.c | 4 | ||||
-rw-r--r-- | sys/compat/svr4/svr4_stat.c | 12 |
6 files changed, 19 insertions, 17 deletions
diff --git a/sys/compat/hpux/hpux_file.c b/sys/compat/hpux/hpux_file.c index e38b32897a9..09740e2cb32 100644 --- a/sys/compat/hpux/hpux_file.c +++ b/sys/compat/hpux/hpux_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hpux_file.c,v 1.6 1997/07/06 07:27:59 downsj Exp $ */ +/* $OpenBSD: hpux_file.c,v 1.7 2000/09/07 17:52:22 ericj Exp $ */ /* $NetBSD: hpux_file.c,v 1.5 1997/04/27 21:40:48 thorpej Exp $ */ /* @@ -451,9 +451,9 @@ hpux_stat1(p, v, retval, dolstat) sg = stackgap_init(p->p_emul); + st = stackgap_alloc(&sg, sizeof (struct stat)); HPUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - st = stackgap_alloc(&sg, sizeof (struct stat)); SCARG(&sa, ub) = st; SCARG(&sa, path) = SCARG(uap, path); diff --git a/sys/compat/ibcs2/ibcs2_misc.c b/sys/compat/ibcs2/ibcs2_misc.c index b817aac8f6c..6a52735b32d 100644 --- a/sys/compat/ibcs2/ibcs2_misc.c +++ b/sys/compat/ibcs2/ibcs2_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ibcs2_misc.c,v 1.15 2000/03/05 20:32:13 deraadt Exp $ */ +/* $OpenBSD: ibcs2_misc.c,v 1.16 2000/09/07 17:52:23 ericj Exp $ */ /* $NetBSD: ibcs2_misc.c,v 1.23 1997/01/15 01:37:49 perry Exp $ */ /* @@ -1018,6 +1018,7 @@ ibcs2_sys_utime(p, v, retval) struct timeval *tp; caddr_t sg = stackgap_init(p->p_emul); + tp = stackgap_alloc(&sg, 2 * sizeof(struct timeval *)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); SCARG(&sa, path) = SCARG(uap, path); if (SCARG(uap, buf)) { @@ -1027,7 +1028,6 @@ ibcs2_sys_utime(p, v, retval) sizeof(ubuf)); if (error) return error; - tp = stackgap_alloc(&sg, 2 * sizeof(struct timeval *)); tp[0].tv_sec = ubuf.actime; tp[0].tv_usec = 0; tp[1].tv_sec = ubuf.modtime; diff --git a/sys/compat/ibcs2/ibcs2_stat.c b/sys/compat/ibcs2/ibcs2_stat.c index 4614b6a1f44..9a076503551 100644 --- a/sys/compat/ibcs2/ibcs2_stat.c +++ b/sys/compat/ibcs2/ibcs2_stat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ibcs2_stat.c,v 1.4 1997/01/23 16:12:19 niklas Exp $ */ +/* $OpenBSD: ibcs2_stat.c,v 1.5 2000/09/07 17:52:23 ericj Exp $ */ /* $NetBSD: ibcs2_stat.c,v 1.5 1996/05/03 17:05:32 christos Exp $ */ /* @@ -171,9 +171,10 @@ ibcs2_sys_stat(p, v, retval) int error; caddr_t sg = stackgap_init(p->p_emul); + SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st)); + if ((error = compat_43_sys_stat(p, &cup, retval)) != 0) return error; if ((error = copyin(SCARG(&cup, ub), &st, sizeof(st))) != 0) @@ -199,9 +200,10 @@ ibcs2_sys_lstat(p, v, retval) int error; caddr_t sg = stackgap_init(p->p_emul); + SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st)); IBCS2_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(st)); + if ((error = compat_43_sys_lstat(p, &cup, retval)) != 0) return error; if ((error = copyin(SCARG(&cup, ub), &st, sizeof(st))) != 0) diff --git a/sys/compat/linux/linux_file.c b/sys/compat/linux/linux_file.c index b1c5e12745a..7f1ae5c2a5d 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.14 2000/07/23 22:24:37 jasoni Exp $ */ +/* $OpenBSD: linux_file.c,v 1.15 2000/09/07 17:52:23 ericj Exp $ */ /* $NetBSD: linux_file.c,v 1.15 1996/05/20 01:59:09 fvdl Exp $ */ /* @@ -519,9 +519,9 @@ linux_stat1(p, v, retval, dolstat) sg = stackgap_init(p->p_emul); + st = stackgap_alloc(&sg, sizeof (struct stat)); LINUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); - st = stackgap_alloc(&sg, sizeof (struct stat)); SCARG(&sa, ub) = st; SCARG(&sa, path) = SCARG(uap, path); diff --git a/sys/compat/linux/linux_misc.c b/sys/compat/linux/linux_misc.c index fe78c9fe6dd..c2ff17cdd62 100644 --- a/sys/compat/linux/linux_misc.c +++ b/sys/compat/linux/linux_misc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_misc.c,v 1.31 2000/07/23 22:35:38 jasoni Exp $ */ +/* $OpenBSD: linux_misc.c,v 1.32 2000/09/07 17:52:24 ericj Exp $ */ /* $NetBSD: linux_misc.c,v 1.27 1996/05/20 01:59:21 fvdl Exp $ */ /* @@ -859,6 +859,7 @@ linux_sys_utime(p, v, retval) struct linux_utimbuf lut; sg = stackgap_init(p->p_emul); + tvp = (struct timeval *) stackgap_alloc(&sg, sizeof(tv)); LINUX_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); SCARG(&ua, path) = SCARG(uap, path); @@ -869,7 +870,6 @@ linux_sys_utime(p, v, retval) tv[0].tv_usec = tv[1].tv_usec = 0; tv[0].tv_sec = lut.l_actime; tv[1].tv_sec = lut.l_modtime; - tvp = (struct timeval *) stackgap_alloc(&sg, sizeof(tv)); if ((error = copyout(tv, tvp, sizeof tv))) return error; SCARG(&ua, tptr) = tvp; diff --git a/sys/compat/svr4/svr4_stat.c b/sys/compat/svr4/svr4_stat.c index 010fb73eef0..ca4ad6476b4 100644 --- a/sys/compat/svr4/svr4_stat.c +++ b/sys/compat/svr4/svr4_stat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: svr4_stat.c,v 1.18 2000/06/24 21:00:30 fgsch Exp $ */ +/* $OpenBSD: svr4_stat.c,v 1.19 2000/09/07 17:52:24 ericj Exp $ */ /* $NetBSD: svr4_stat.c,v 1.21 1996/04/22 01:16:07 christos Exp $ */ /* @@ -170,10 +170,10 @@ svr4_sys_stat(p, v, retval) int error; caddr_t sg = stackgap_init(p->p_emul); + SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); SVR4_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = sys_stat(p, &cup, retval)) != 0) @@ -215,10 +215,10 @@ svr4_sys_lstat(p, v, retval) int error; caddr_t sg = stackgap_init(p->p_emul); + SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); SVR4_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = sys_lstat(p, &cup, retval)) != 0) return error; @@ -292,10 +292,10 @@ svr4_sys_xstat(p, v, retval) int error; caddr_t sg = stackgap_init(p->p_emul); + SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); SVR4_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = sys_stat(p, &cup, retval)) != 0) return error; @@ -327,10 +327,10 @@ svr4_sys_lxstat(p, v, retval) int error; caddr_t sg = stackgap_init(p->p_emul); + SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); SVR4_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); SCARG(&cup, path) = SCARG(uap, path); - SCARG(&cup, ub) = stackgap_alloc(&sg, sizeof(struct stat)); if ((error = sys_lstat(p, &cup, retval)) != 0) return error; @@ -711,6 +711,7 @@ svr4_sys_utime(p, v, retval) int error; caddr_t sg = stackgap_init(p->p_emul); + SCARG(&ap, tptr) = stackgap_alloc(&sg, sizeof(tbuf)); SVR4_CHECK_ALT_EXIST(p, &sg, SCARG(uap, path)); SCARG(&ap, path) = SCARG(uap, path); if (SCARG(uap, ubuf) != NULL) { @@ -720,7 +721,6 @@ svr4_sys_utime(p, v, retval) tbuf[0].tv_usec = 0; tbuf[1].tv_sec = ub.modtime; tbuf[1].tv_usec = 0; - SCARG(&ap, tptr) = stackgap_alloc(&sg, sizeof(tbuf)); error = copyout(tbuf, (struct timeval *)SCARG(&ap, tptr), sizeof(tbuf)); if (error) return error; |