sys_pipe.c (2b68eb8e1dbbdaf6a0df1c83b26f5403ca52d4c3) sys_pipe.c (7259ca31048e5ced8e7f90657a3d7084aeafdf51)
1/*-
2 * SPDX-License-Identifier: BSD-4-Clause
3 *
4 * Copyright (c) 1996 John S. Dyson
5 * Copyright (c) 2012 Giovanni Trematerra
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

1746 if (cpipe->pipe_peer->pipe_present != PIPE_ACTIVE) {
1747 /* other end of pipe has been closed */
1748 PIPE_UNLOCK(cpipe);
1749 return (EPIPE);
1750 }
1751 cpipe = PIPE_PEER(cpipe);
1752 break;
1753 default:
1/*-
2 * SPDX-License-Identifier: BSD-4-Clause
3 *
4 * Copyright (c) 1996 John S. Dyson
5 * Copyright (c) 2012 Giovanni Trematerra
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

1746 if (cpipe->pipe_peer->pipe_present != PIPE_ACTIVE) {
1747 /* other end of pipe has been closed */
1748 PIPE_UNLOCK(cpipe);
1749 return (EPIPE);
1750 }
1751 cpipe = PIPE_PEER(cpipe);
1752 break;
1753 default:
1754 if ((cpipe->pipe_type & PIPE_TYPE_NAMED) != 0) {
1755 PIPE_UNLOCK(cpipe);
1756 return (vnops.fo_kqfilter(fp, kn));
1757 }
1754 PIPE_UNLOCK(cpipe);
1755 return (EINVAL);
1756 }
1757
1758 kn->kn_hook = cpipe;
1759 knlist_add(&cpipe->pipe_sel.si_note, kn, 1);
1760 PIPE_UNLOCK(cpipe);
1761 return (0);

--- 79 unchanged lines hidden ---
1758 PIPE_UNLOCK(cpipe);
1759 return (EINVAL);
1760 }
1761
1762 kn->kn_hook = cpipe;
1763 knlist_add(&cpipe->pipe_sel.si_note, kn, 1);
1764 PIPE_UNLOCK(cpipe);
1765 return (0);

--- 79 unchanged lines hidden ---