This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate:
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 14 Jun 2003 08:06:18 +0000 (08:06 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 14 Jun 2003 08:06:18 +0000 (08:06 +0000)
[ 19772]
Illegal cpp.

[ 19773]
Slight reorg of the binmode() entry.
p4raw-link: @19773 on //depot/perl: d807c6f47279587c65cc51a3a68d28c6078f0f1d
p4raw-link: @19772 on //depot/perl: 358837b893c99fff8f52773c2a0b23e17d8dcdb7

p4raw-id: //depot/maint-5.8/perl@19774
p4raw-integrated: from //depot/perl@19771 'merge in' pod/perlfunc.pod
(@19672..) util.c (@19765..)

pod/perlfunc.pod
util.c

index 87eba5a..11fecf6 100644 (file)
@@ -457,6 +457,19 @@ binary and text files.  If FILEHANDLE is an expression, the value is
 taken as the name of the filehandle.  Returns true on success,
 otherwise it returns C<undef> and sets C<$!> (errno).
 
+On some systems (in general, DOS and Windows-based systems) binmode()
+is necessary when you're not working with a text file.  For the sake
+of portability it is a good idea to always use it when appropriate,
+and to never use it when it isn't appropriate.  Also, people can
+set their I/O to be by default UTF-8 encoded Unicode, not bytes.
+
+In other words: regardless of platform, use binmode() on binary data,
+like for example images.
+
+If LAYER is present it is a single string, but may contain multiple
+directives. The directives alter the behaviour of the file handle.
+When LAYER is present using binmode on text file makes sense.
+
 If LAYER is omitted or specified as C<:raw> the filehandle is made
 suitable for passing binary data. This includes turning off possible CRLF
 translation and marking it as bytes (as opposed to Unicode characters).
@@ -466,6 +479,10 @@ Note that as despite what may be implied in I<"Programming Perl">
 I<also> disabled. See L<PerlIO>, L<perlrun> and the discussion about the
 PERLIO environment variable.
 
+The C<:bytes>, C<:crlf>, and C<:utf8>, and any other directives of the
+form C<:...>, are called I/O I<layers>.  The C<open> pragma can be used to
+establish default I/O layers.  See L<open>.
+
 I<The LAYER parameter of the binmode() function is described as "DISCIPLINE"
 in "Programming Perl, 3rd Edition".  However, since the publishing of this
 book, by many known as "Camel III", the consensus of the naming of this
@@ -473,25 +490,8 @@ functionality has moved from "discipline" to "layer".  All documentation
 of this version of Perl therefore refers to "layers" rather than to
 "disciplines".  Now back to the regularly scheduled documentation...>
 
-On some systems (in general, DOS and Windows-based systems) binmode()
-is necessary when you're not working with a text file.  For the sake
-of portability it is a good idea to always use it when appropriate,
-and to never use it when it isn't appropriate.
-
-In other words: regardless of platform, use binmode() on binary files
-(like for example images).
-
-If LAYER is present it is a single string, but may contain
-multiple directives. The directives alter the behaviour of the
-file handle. When LAYER is present using binmode on text
-file makes sense.
-
 To mark FILEHANDLE as UTF-8, use C<:utf8>.
 
-The C<:bytes>, C<:crlf>, and C<:utf8>, and any other directives of the
-form C<:...>, are called I/O I<layers>.  The C<open> pragma can be used to
-establish default I/O layers.  See L<open>.
-
 In general, binmode() should be called after open() but before any I/O
 is done on the filehandle.  Calling binmode() will normally flush any
 pending buffered output data (and perhaps pending input data) on the
diff --git a/util.c b/util.c
index c937c91..2e038a3 100644 (file)
--- a/util.c
+++ b/util.c
@@ -2207,7 +2207,7 @@ Perl_rsignal(pTHX_ int signo, Sighandler_t handler)
     if (PL_signals & PERL_SIGNALS_UNSAFE_FLAG)
         act.sa_flags |= SA_RESTART;    /* SVR4, 4.3+BSD */
 #endif
-#ifdef SA_NOCLDWAIT && !defined(BSDish) /* See [perl #18849] */
+#if defined(SA_NOCLDWAIT) && !defined(BSDish) /* See [perl #18849] */
     if (signo == SIGCHLD && handler == (Sighandler_t)SIG_IGN)
        act.sa_flags |= SA_NOCLDWAIT;
 #endif