Deleted Added
sdiff udiff text old ( 11397 ) new ( 11527 )
full compact
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

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

18 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
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
28#include <sys/param.h>
29#include <sys/systm.h>
30#include <sys/namei.h>
31#include <sys/proc.h>
32#include <sys/file.h>
33#include <sys/stat.h>

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

180
181 SCARG(uap, flags) = cvt_o_flags(SCARG(uap, flags));
182 if (SCARG(uap, flags) & O_CREAT)
183 CHECKALTCREAT(p, &sg, SCARG(uap, path));
184 else
185 CHECKALTEXIST(p, &sg, SCARG(uap, path));
186 ret = open(p, (struct open_args *)uap, retval);
187
188 if (!ret && !noctty && SESS_LEADER(p) && !(p->p_flag & P_CONTROLT)) {
189 struct filedesc *fdp = p->p_fd;
190 struct file *fp = fdp->fd_ofiles[*retval];
191
192 /* ignore any error, just give it a try */
193 if (fp->f_type == DTYPE_VNODE)
194 (fp->f_ops->fo_ioctl)(fp, TIOCSCTTY, (caddr_t) 0, p);
195 }

--- 129 unchanged lines hidden ---