Skip to content

Commit a99909a

Browse files
committed
[DOC] Remove redundant directives
1 parent 8e64399 commit a99909a

File tree

1 file changed

+28
-56
lines changed

1 file changed

+28
-56
lines changed

ext/fcntl/fcntl.c

Lines changed: 28 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ Init_fcntl(void)
7272
rb_define_const(mFcntl, "VERSION", rb_str_new_cstr(FCNTL_VERSION));
7373

7474
#ifdef F_DUPFD
75-
/* Document-const: F_DUPFD
76-
*
75+
/*
7776
* Duplicate a file descriptor to the minimum unused file descriptor
7877
* greater than or equal to the argument.
7978
*
@@ -84,195 +83,168 @@ Init_fcntl(void)
8483
rb_define_const(mFcntl, "F_DUPFD", INT2NUM(F_DUPFD));
8584
#endif
8685
#ifdef F_GETFD
87-
/* Document-const: F_GETFD
88-
*
86+
/*
8987
* Read the close-on-exec flag of a file descriptor.
9088
*/
9189
rb_define_const(mFcntl, "F_GETFD", INT2NUM(F_GETFD));
9290
#endif
9391
#ifdef F_GETLK
94-
/* Document-const: F_GETLK
95-
*
92+
/*
9693
* Determine whether a given region of a file is locked. This uses one of
9794
* the F_*LK flags.
9895
*/
9996
rb_define_const(mFcntl, "F_GETLK", INT2NUM(F_GETLK));
10097
#endif
10198
#ifdef F_SETFD
102-
/* Document-const: F_SETFD
103-
*
99+
/*
104100
* Set the close-on-exec flag of a file descriptor.
105101
*/
106102
rb_define_const(mFcntl, "F_SETFD", INT2NUM(F_SETFD));
107103
#endif
108104
#ifdef F_GETFL
109-
/* Document-const: F_GETFL
110-
*
105+
/*
111106
* Get the file descriptor flags. This will be one or more of the O_*
112107
* flags.
113108
*/
114109
rb_define_const(mFcntl, "F_GETFL", INT2NUM(F_GETFL));
115110
#endif
116111
#ifdef F_SETFL
117-
/* Document-const: F_SETFL
118-
*
112+
/*
119113
* Set the file descriptor flags. This will be one or more of the O_*
120114
* flags.
121115
*/
122116
rb_define_const(mFcntl, "F_SETFL", INT2NUM(F_SETFL));
123117
#endif
124118
#ifdef F_SETLK
125-
/* Document-const: F_SETLK
126-
*
119+
/*
127120
* Acquire a lock on a region of a file. This uses one of the F_*LCK
128121
* flags.
129122
*/
130123
rb_define_const(mFcntl, "F_SETLK", INT2NUM(F_SETLK));
131124
#endif
132125
#ifdef F_SETLKW
133-
/* Document-const: F_SETLKW
134-
*
126+
/*
135127
* Acquire a lock on a region of a file, waiting if necessary. This uses
136128
* one of the F_*LCK flags
137129
*/
138130
rb_define_const(mFcntl, "F_SETLKW", INT2NUM(F_SETLKW));
139131
#endif
140132
#ifdef FD_CLOEXEC
141-
/* Document-const: FD_CLOEXEC
142-
*
133+
/*
143134
* the value of the close-on-exec flag.
144135
*/
145136
rb_define_const(mFcntl, "FD_CLOEXEC", INT2NUM(FD_CLOEXEC));
146137
#endif
147138
#ifdef F_RDLCK
148-
/* Document-const: F_RDLCK
149-
*
139+
/*
150140
* Read lock for a region of a file
151141
*/
152142
rb_define_const(mFcntl, "F_RDLCK", INT2NUM(F_RDLCK));
153143
#endif
154144
#ifdef F_UNLCK
155-
/* Document-const: F_UNLCK
156-
*
145+
/*
157146
* Remove lock for a region of a file
158147
*/
159148
rb_define_const(mFcntl, "F_UNLCK", INT2NUM(F_UNLCK));
160149
#endif
161150
#ifdef F_WRLCK
162-
/* Document-const: F_WRLCK
163-
*
151+
/*
164152
* Write lock for a region of a file
165153
*/
166154
rb_define_const(mFcntl, "F_WRLCK", INT2NUM(F_WRLCK));
167155
#endif
168156
#ifdef F_SETPIPE_SZ
169-
/* Document-const: F_SETPIPE_SZ
170-
*
157+
/*
171158
* Change the capacity of the pipe referred to by fd to be at least arg bytes.
172159
*/
173160
rb_define_const(mFcntl, "F_SETPIPE_SZ", INT2NUM(F_SETPIPE_SZ));
174161
#endif
175162
#ifdef F_GETPIPE_SZ
176-
/* Document-const: F_GETPIPE_SZ
177-
*
163+
/*
178164
* Return (as the function result) the capacity of the pipe referred to by fd.
179165
*/
180166
rb_define_const(mFcntl, "F_GETPIPE_SZ", INT2NUM(F_GETPIPE_SZ));
181167
#endif
182168
#ifdef O_CREAT
183-
/* Document-const: O_CREAT
184-
*
169+
/*
185170
* Create the file if it doesn't exist
186171
*/
187172
rb_define_const(mFcntl, "O_CREAT", INT2NUM(O_CREAT));
188173
#endif
189174
#ifdef O_EXCL
190-
/* Document-const: O_EXCL
191-
*
175+
/*
192176
* Used with O_CREAT, fail if the file exists
193177
*/
194178
rb_define_const(mFcntl, "O_EXCL", INT2NUM(O_EXCL));
195179
#endif
196180
#ifdef O_NOCTTY
197-
/* Document-const: O_NOCTTY
198-
*
181+
/*
199182
* Open TTY without it becoming the controlling TTY
200183
*/
201184
rb_define_const(mFcntl, "O_NOCTTY", INT2NUM(O_NOCTTY));
202185
#endif
203186
#ifdef O_TRUNC
204-
/* Document-const: O_TRUNC
205-
*
187+
/*
206188
* Truncate the file on open
207189
*/
208190
rb_define_const(mFcntl, "O_TRUNC", INT2NUM(O_TRUNC));
209191
#endif
210192
#ifdef O_APPEND
211-
/* Document-const: O_APPEND
212-
*
193+
/*
213194
* Open the file in append mode
214195
*/
215196
rb_define_const(mFcntl, "O_APPEND", INT2NUM(O_APPEND));
216197
#endif
217198
#ifdef O_NONBLOCK
218-
/* Document-const: O_NONBLOCK
219-
*
199+
/*
220200
* Open the file in non-blocking mode
221201
*/
222202
rb_define_const(mFcntl, "O_NONBLOCK", INT2NUM(O_NONBLOCK));
223203
#endif
224204
#ifdef O_NDELAY
225-
/* Document-const: O_NDELAY
226-
*
205+
/*
227206
* Open the file in non-blocking mode
228207
*/
229208
rb_define_const(mFcntl, "O_NDELAY", INT2NUM(O_NDELAY));
230209
#endif
231210
#ifdef O_RDONLY
232-
/* Document-const: O_RDONLY
233-
*
211+
/*
234212
* Open the file in read-only mode
235213
*/
236214
rb_define_const(mFcntl, "O_RDONLY", INT2NUM(O_RDONLY));
237215
#endif
238216
#ifdef O_RDWR
239-
/* Document-const: O_RDWR
240-
*
217+
/*
241218
* Open the file in read-write mode
242219
*/
243220
rb_define_const(mFcntl, "O_RDWR", INT2NUM(O_RDWR));
244221
#endif
245222
#ifdef O_WRONLY
246-
/* Document-const: O_WRONLY
247-
*
223+
/*
248224
* Open the file in write-only mode.
249225
*/
250226
rb_define_const(mFcntl, "O_WRONLY", INT2NUM(O_WRONLY));
251227
#endif
252228
#ifdef O_ACCMODE
253-
/* Document-const: O_ACCMODE
254-
*
229+
/*
255230
* Mask to extract the read/write flags
256231
*/
257232
rb_define_const(mFcntl, "O_ACCMODE", INT2FIX(O_ACCMODE));
258233
#else
259-
/* Document-const: O_ACCMODE
260-
*
234+
/*
261235
* Mask to extract the read/write flags
262236
*/
263237
rb_define_const(mFcntl, "O_ACCMODE", INT2FIX(O_RDONLY | O_WRONLY | O_RDWR));
264238
#endif
265239
#ifdef F_DUP2FD
266-
/* Document-const: F_DUP2FD
267-
*
240+
/*
268241
* It is a FreeBSD specific constant and equivalent
269242
* to dup2 call.
270243
*/
271244
rb_define_const(mFcntl, "F_DUP2FD", INT2NUM(F_DUP2FD));
272245
#endif
273246
#ifdef F_DUP2FD_CLOEXEC
274-
/* Document-const: F_DUP2FD_CLOEXEC
275-
*
247+
/*
276248
* It is a FreeBSD specific constant and acts
277249
* similarly as F_DUP2FD but set the FD_CLOEXEC
278250
* flag in addition.

0 commit comments

Comments
 (0)