ruby-changes:26907
From: akr <ko1@a...>
Date: Mon, 28 Jan 2013 12:35:24 +0900 (JST)
Subject: [ruby-changes:26907] akr:r38959 (trunk): * ext/fcntl/fcntl.c: update document. use "file descriptor" instead
akr 2013-01-28 12:34:43 +0900 (Mon, 28 Jan 2013) New Revision: 38959 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=38959 Log: * ext/fcntl/fcntl.c: update document. use "file descriptor" instead of "file handle" because it is not used other Ruby documents and it is confusing with Windows file handle. correct F_DUPFD behavior. Modified files: trunk/ChangeLog trunk/ext/fcntl/fcntl.c Index: ChangeLog =================================================================== --- ChangeLog (revision 38958) +++ ChangeLog (revision 38959) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Mon Jan 28 12:32:31 2013 Tanaka Akira <akr@f...> + + * ext/fcntl/fcntl.c: update document. use "file descriptor" instead + of "file handle" because it is not used other Ruby documents and + it is confusing with Windows file handle. + correct F_DUPFD behavior. + Sat Jan 26 22:39:12 2013 Nobuyoshi Nakada <nobu@r...> * marshal.c (w_object): dump instance variables of the result of Index: ext/fcntl/fcntl.c =================================================================== --- ext/fcntl/fcntl.c (revision 38958) +++ ext/fcntl/fcntl.c (revision 38959) @@ -68,15 +68,19 @@ Init_fcntl() https://github.com/ruby/ruby/blob/trunk/ext/fcntl/fcntl.c#L68 #ifdef F_DUPFD /* Document-const: F_DUPFD * - * Duplicate a close-on-exec file handle to a non-close-on-exec file - * handle. + * Duplicate a file descriptor to the mimimum unused file descriptor + * greater than or equal to the argument. + * + * The close-on-exec flag of the duplicated file descriptor is set. + * (Ruby uses F_DUPFD_CLOEXEC internally if available to avoid race + * condition. F_SETFD is used if F_DUPFD_CLOEXEC is not available.) */ rb_define_const(mFcntl, "F_DUPFD", INT2NUM(F_DUPFD)); #endif #ifdef F_GETFD /* Document-const: F_GETFD * - * Read the close-on-exec flag of a file handle. + * Read the close-on-exec flag of a file descriptor. */ rb_define_const(mFcntl, "F_GETFD", INT2NUM(F_GETFD)); #endif @@ -91,7 +95,7 @@ Init_fcntl() https://github.com/ruby/ruby/blob/trunk/ext/fcntl/fcntl.c#L95 #ifdef F_SETFD /* Document-const: F_SETFD * - * Set the close-on-exec flag of a file handle. + * Set the close-on-exec flag of a file descriptor. */ rb_define_const(mFcntl, "F_SETFD", INT2NUM(F_SETFD)); #endif @@ -128,7 +132,7 @@ Init_fcntl() https://github.com/ruby/ruby/blob/trunk/ext/fcntl/fcntl.c#L132 rb_define_const(mFcntl, "F_SETLKW", INT2NUM(F_SETLKW)); #endif #ifdef FD_CLOEXEC - /* Document-const: F_CLOEXEC + /* Document-const: FD_CLOEXEC * * the value of the close-on-exec flag. */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/