From: Rafael Garcia-Suarez Date: Fri, 31 Aug 2007 13:28:46 +0000 (+0000) Subject: Following Jan's advice, remove Cygwin::is_textmount(), X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b7dcf5ac94bed0f662436876fc7ea3297cbf179;p=p5sagit%2Fp5-mst-13.2.git Following Jan's advice, remove Cygwin::is_textmount(), which duplicates the functionality of is_binmount(). p4raw-id: //depot/perl@31773 --- diff --git a/README.cygwin b/README.cygwin index ac85a9d..3bccc3e 100644 --- a/README.cygwin +++ b/README.cygwin @@ -409,10 +409,10 @@ F When a file is opened it is in either text or binary mode. In text mode a file is subject to CR/LF/Ctrl-Z translations. With Cygwin, the default mode for an C is determined by the mode of the mount that underlies -the file. See C and C. -Perl provides a C function to set binary mode on files -that otherwise would be treated as text. C with the C -flag sets text mode on files that otherwise would be treated as binary: +the file. See C. Perl provides a C function +to set binary mode on files that otherwise would be treated as text. +C with the C flag sets text mode on files that otherwise +would be treated as binary: sysopen(FOO, "bar", O_WRONLY|O_CREAT|O_TEXT) @@ -557,11 +557,6 @@ User mounts override system mounts. Returns true if the given cygwin path is binary mounted, false if the path is mounted in textmode. -=item C - -Returns true if the given cygwin path is mounted in textmode (C<"\r\n"> C=C C<"\n">), -false if the path is mounted binary. The result is complementary to C. - =back =head1 INSTALL PERL ON CYGWIN diff --git a/cygwin/cygwin.c b/cygwin/cygwin.c index 60d7d94..8a1ef03 100644 --- a/cygwin/cygwin.c +++ b/cygwin/cygwin.c @@ -347,20 +347,6 @@ XS(XS_Cygwin_is_binmount) XSRETURN(1); } -XS(XS_Cygwin_is_textmount) -{ - dXSARGS; - char *pathname; - - if (items != 1) - Perl_croak(aTHX_ "Usage: Cygwin::is_textmount(pathname)"); - - pathname = SvPV_nolen(ST(0)); - - ST(0) = boolSV(!cygwin_internal(CW_GET_BINMODE, pathname)); - XSRETURN(1); -} - void init_os_extras(void) { @@ -376,7 +362,6 @@ init_os_extras(void) newXSproto("Cygwin::mount_table", XS_Cygwin_mount_table, file, ""); newXSproto("Cygwin::mount_flags", XS_Cygwin_mount_flags, file, "$"); newXSproto("Cygwin::is_binmount", XS_Cygwin_is_binmount, file, "$"); - newXSproto("Cygwin::is_textmount", XS_Cygwin_is_textmount, file, "$"); /* Initialize Win32CORE if it has been statically linked. */ handle = dlopen(NULL, RTLD_LAZY); diff --git a/t/lib/cygwin.t b/t/lib/cygwin.t index 00cd05f..d92031d 100644 --- a/t/lib/cygwin.t +++ b/t/lib/cygwin.t @@ -9,7 +9,7 @@ BEGIN { } } -use Test::More tests => 15; +use Test::More tests => 14; is(Cygwin::winpid_to_pid(Cygwin::pid_to_winpid($$)), $$, "perl pid translates to itself"); @@ -46,7 +46,6 @@ my $mount = join '', `/usr/bin/mount`; $mount =~ m|on /usr/bin type .+ \((\w+mode)\)|m; my $binmode = $1 eq 'binmode'; is(Cygwin::is_binmount("/"), $binmode ? 1 : '', "check / for binmount"); -is(Cygwin::is_textmount("/"), $binmode ? '' : 1, "check / for textmount"); my $rootmnt = Cygwin::mount_flags("/"); ok($binmode ? ($rootmnt =~ /,binmode/) : ($rootmnt =~ /,textmode/), "check / mount_flags");