Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/io/pipemod.c
+++ new/usr/src/uts/common/io/pipemod.c
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License, Version 1.0 only
6 6 * (the "License"). You may not use this file except in compliance
7 7 * with the License.
8 8 *
9 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 10 * or http://www.opensolaris.org/os/licensing.
11 11 * See the License for the specific language governing permissions
12 12 * and limitations under the License.
13 13 *
14 14 * When distributing Covered Code, include this CDDL HEADER in each
15 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 16 * If applicable, add the following below this CDDL HEADER, with the
17 17 * fields enclosed by brackets "[]" replaced with your own identifying
18 18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 19 *
20 20 * CDDL HEADER END
↓ open down ↓ |
20 lines elided |
↑ open up ↑ |
21 21 */
22 22 /*
23 23 * Copyright (c) 1997, by Sun Microsystems, Inc.
24 24 * All rights reserved.
25 25 */
26 26
27 27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 28 /* All Rights Reserved */
29 29
30 30
31 -#pragma ident "%Z%%M% %I% %E% SMI"
32 -
33 31 /*
34 32 * This module switches the read and write flush bits for each
35 33 * M_FLUSH control message it receives. It's intended usage is to
36 34 * properly flush a STREAMS-based pipe.
37 35 */
38 36 #include <sys/types.h>
39 37 #include <sys/param.h>
40 38 #include <sys/errno.h>
41 39 #include <sys/stream.h>
42 40 #include <sys/stropts.h>
43 41
44 42 #include <sys/conf.h>
45 43 #include <sys/modctl.h>
46 44
47 45 /*ARGSUSED*/
48 46 static int
49 47 pipeopen(queue_t *rqp, dev_t *devp, int flag, int sflag, cred_t *crp)
50 48 {
51 49 qprocson(rqp);
52 50 return (0);
53 51 }
54 52
55 53 /*ARGSUSED*/
56 54 static int
57 55 pipeclose(queue_t *q, int cflag, cred_t *crp)
58 56 {
59 57 qprocsoff(q);
60 58 return (0);
61 59 }
62 60
63 61 /*
64 62 * Use same put procedure for write and read queues.
65 63 * If mp is an M_FLUSH message, switch the FLUSHW to FLUSHR and
66 64 * the FLUSHR to FLUSHW and send the message on. If mp is not an
67 65 * M_FLUSH message, send it on with out processing.
68 66 */
69 67 static int
70 68 pipeput(queue_t *qp, mblk_t *mp)
71 69 {
72 70 switch (mp->b_datap->db_type) {
73 71 case M_FLUSH:
74 72 if (!(*mp->b_rptr & FLUSHR && *mp->b_rptr & FLUSHW)) {
75 73 if (*mp->b_rptr & FLUSHW) {
76 74 *mp->b_rptr |= FLUSHR;
77 75 *mp->b_rptr &= ~FLUSHW;
78 76 } else {
79 77 *mp->b_rptr |= FLUSHW;
80 78 *mp->b_rptr &= ~FLUSHR;
81 79 }
82 80 }
83 81 break;
84 82
85 83 default:
86 84 break;
87 85 }
88 86 putnext(qp, mp);
89 87 return (0);
90 88 }
91 89
92 90 static struct module_info pipe_info = {
93 91 1003, "pipemod", 0, INFPSZ, STRHIGH, STRLOW
94 92 };
95 93
96 94 static struct qinit piperinit = {
97 95 pipeput, NULL, pipeopen, pipeclose, NULL, &pipe_info, NULL
98 96 };
99 97
100 98 static struct qinit pipewinit = {
101 99 pipeput, NULL, NULL, NULL, NULL, &pipe_info, NULL
102 100 };
103 101
104 102 static struct streamtab pipeinfo = { &piperinit, &pipewinit, NULL, NULL };
105 103
106 104 static struct fmodsw fsw = {
↓ open down ↓ |
64 lines elided |
↑ open up ↑ |
107 105 "pipemod",
108 106 &pipeinfo,
109 107 D_NEW | D_MP
110 108 };
111 109
112 110 static struct modlstrmod modlstrmod = {
113 111 &mod_strmodops, "pipe flushing module", &fsw
114 112 };
115 113
116 114 static struct modlinkage modlinkage = {
117 - MODREV_1, &modlstrmod, NULL
115 + MODREV_1, { &modlstrmod, NULL }
118 116 };
119 117
120 118 int
121 119 _init(void)
122 120 {
123 121 return (mod_install(&modlinkage));
124 122 }
125 123
126 124 int
127 125 _fini(void)
128 126 {
129 127 return (mod_remove(&modlinkage));
130 128 }
131 129
132 130 int
133 131 _info(struct modinfo *modinfop)
134 132 {
135 133 return (mod_info(&modlinkage, modinfop));
136 134 }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX