Deleted Added
full compact
ibcs2_fcntl.c (89306) ibcs2_fcntl.c (89319)
1/*
2 * Copyright (c) 1995 Scott Bartram
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 10 unchanged lines hidden (view full) ---

19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
1/*
2 * Copyright (c) 1995 Scott Bartram
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 10 unchanged lines hidden (view full) ---

19 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/i386/ibcs2/ibcs2_fcntl.c 89306 2002-01-13 11:58:06Z alfred $
27 * $FreeBSD: head/sys/i386/ibcs2/ibcs2_fcntl.c 89319 2002-01-14 00:13:45Z alfred $
28 */
29
30#include "opt_spx_hack.h"
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/fcntl.h>
35#include <sys/file.h>

--- 153 unchanged lines hidden (view full) ---

189 if (ret == ENXIO) {
190 if (!strcmp(SCARG(uap, path), "/compat/ibcs2/dev/spx"))
191 ret = spx_open(td, uap);
192 } else
193#endif /* SPX_HACK */
194 PROC_LOCK(p);
195 if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) {
196 struct file *fp;
28 */
29
30#include "opt_spx_hack.h"
31
32#include <sys/param.h>
33#include <sys/systm.h>
34#include <sys/fcntl.h>
35#include <sys/file.h>

--- 153 unchanged lines hidden (view full) ---

189 if (ret == ENXIO) {
190 if (!strcmp(SCARG(uap, path), "/compat/ibcs2/dev/spx"))
191 ret = spx_open(td, uap);
192 } else
193#endif /* SPX_HACK */
194 PROC_LOCK(p);
195 if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) {
196 struct file *fp;
197 int error;
197
198
198 fp = ffind_hold(td, td->td_retval[0]);
199 error = fget(td, td->td_retval[0], &fp);
199 PROC_UNLOCK(p);
200 PROC_UNLOCK(p);
200 if (fp == NULL)
201 if (error)
201 return (EBADF);
202
203 /* ignore any error, just give it a try */
204 if (fp->f_type == DTYPE_VNODE)
205 fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td);
206 fdrop(fp, td);
207 } else
208 PROC_UNLOCK(p);

--- 127 unchanged lines hidden ---
202 return (EBADF);
203
204 /* ignore any error, just give it a try */
205 if (fp->f_type == DTYPE_VNODE)
206 fo_ioctl(fp, TIOCSCTTY, (caddr_t) 0, td);
207 fdrop(fp, td);
208 } else
209 PROC_UNLOCK(p);

--- 127 unchanged lines hidden ---