Print this page
7127 remove -Wno-missing-braces from Makefile.uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/io/strredirm.c
+++ new/usr/src/uts/common/io/strredirm.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 (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
↓ open down ↓ |
16 lines elided |
↑ open up ↑ |
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26
27 -#pragma ident "%Z%%M% %I% %E% SMI"
28 -
29 27 /*
30 28 * Redirection STREAMS module.
31 29 *
32 30 * This module is intended for use in conjunction with instantiations of the
33 31 * redirection driver. Its purpose in life is to detect when the stream that
34 32 * it's pushed on is closed, thereupon calling back into the redirection
35 33 * driver so that the driver can cancel redirection to the stream.
36 34 * It passes all messages on unchanged, in both directions.
37 35 */
38 36
39 37 #include <sys/types.h>
40 38 #include <sys/param.h>
41 39 #include <sys/errno.h>
42 40 #include <sys/stream.h>
43 41 #include <sys/stropts.h>
44 42 #include <sys/debug.h>
45 43 #include <sys/strredir.h>
46 44 #include <sys/strsubr.h>
47 45 #include <sys/strsun.h>
48 46 #include <sys/conf.h>
49 47 #include <sys/ddi.h>
50 48 #include <sys/sunddi.h>
51 49 #include <sys/modctl.h>
52 50
53 51 /*
54 52 * Forward declarations for private routines.
55 53 */
56 54 static int wcmopen(queue_t *, dev_t *, int, int, cred_t *);
57 55 static int wcmclose(queue_t *, int, cred_t *);
58 56 static int wcmrput(queue_t *, mblk_t *);
59 57
60 58 static struct module_info wcminfo = {
61 59 STRREDIR_MODID,
62 60 STRREDIR_MOD,
63 61 0,
64 62 INFPSZ,
65 63 5120,
66 64 1024
67 65 };
68 66
69 67 static struct qinit wcmrinit = {
70 68 wcmrput, /* put */
71 69 NULL, /* service */
72 70 wcmopen, /* open */
73 71 wcmclose, /* close */
74 72 NULL, /* qadmin */
75 73 &wcminfo,
76 74 NULL /* mstat */
77 75 };
78 76
79 77 static struct qinit wcmwinit = {
80 78 (int (*)())putnext, /* put */
81 79 NULL, /* service */
82 80 wcmopen, /* open */
83 81 wcmclose, /* close */
84 82 NULL, /* qadmin */
85 83 &wcminfo,
86 84 NULL /* mstat */
87 85 };
88 86
89 87 static struct streamtab redirminfo = {
90 88 &wcmrinit,
91 89 &wcmwinit,
92 90 NULL,
93 91 NULL
94 92 };
95 93
96 94 static struct fmodsw fsw = {
97 95 "redirmod",
98 96 &redirminfo,
↓ open down ↓ |
60 lines elided |
↑ open up ↑ |
99 97 D_MP
100 98 };
101 99
102 100 static struct modlstrmod modlstrmod = {
103 101 &mod_strmodops,
104 102 "redirection module",
105 103 &fsw
106 104 };
107 105
108 106 static struct modlinkage modlinkage = {
109 - MODREV_1, &modlstrmod, NULL
107 + MODREV_1, { &modlstrmod, NULL }
110 108 };
111 109
112 110 int
113 111 _init()
114 112 {
115 113 return (mod_install(&modlinkage));
116 114 }
117 115
118 116 int
119 117 _fini()
120 118 {
121 119 return (EBUSY);
122 120 }
123 121
124 122 int
125 123 _info(struct modinfo *modinfop)
126 124 {
127 125 return (mod_info(&modlinkage, modinfop));
128 126 }
129 127
130 128 /* ARGSUSED */
131 129 static int
132 130 wcmopen(queue_t *q, dev_t *dev, int flag, int sflag, cred_t *cred)
133 131 {
134 132 if (sflag != MODOPEN)
135 133 return (EINVAL);
136 134 qprocson(q);
137 135 return (0);
138 136 }
139 137
140 138 /* ARGSUSED */
141 139 static int
142 140 wcmclose(queue_t *q, int flag, cred_t *cred)
143 141 {
144 142 qprocsoff(q);
145 143 srpop(q->q_stream->sd_vnode, B_TRUE);
146 144 return (0);
147 145 }
148 146
149 147 /*
150 148 * Upstream messages are passed unchanged.
151 149 * If a hangup occurs the target is no longer usable, so deprecate it.
152 150 */
153 151 static int
154 152 wcmrput(queue_t *q, mblk_t *mp)
155 153 {
156 154 if (DB_TYPE(mp) == M_HANGUP)
157 155 /* Don't block waiting for outstanding operations to complete */
158 156 srpop(q->q_stream->sd_vnode, B_FALSE);
159 157 putnext(q, mp);
160 158 return (0);
161 159 }
↓ open down ↓ |
42 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX