summaryrefslogtreecommitdiff
path: root/win32/win32io.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-06-19 20:50:54 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-06-19 20:50:54 +0000
commit86e05cf231bed3044bd929f19303d6a3d872b202 (patch)
treeadeabf78be879a3b98ed3d8e351d7a4703706622 /win32/win32io.c
parent277dad4e2320e5690f5933980b28aa5eb246f197 (diff)
downloadperl-86e05cf231bed3044bd929f19303d6a3d872b202.tar.gz
"Clean" implementation of binmode(FH)/":raw" identity.
New function table entry so all layer definitions need tweaking. Extra function table entry allows a layer to remain on a binmode stack New PerlIOBase_binmode allows easy implementation of default policy. p4raw-id: //depot/perlio@17309
Diffstat (limited to 'win32/win32io.c')
-rw-r--r--win32/win32io.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/win32/win32io.c b/win32/win32io.c
index 3cf31c5629..7997658f4e 100644
--- a/win32/win32io.c
+++ b/win32/win32io.c
@@ -288,9 +288,9 @@ PerlIOWin32_close(pTHX_ PerlIO *f)
PerlIOWin32 *s = PerlIOSelf(f,PerlIOWin32);
if (s->refcnt == 1)
{
- IV code = 0;
+ IV code = 0;
#if 0
- /* This does not do pipes etc. correctly */
+ /* This does not do pipes etc. correctly */
if (!CloseHandle(s->h))
{
s->h = INVALID_HANDLE_VALUE;
@@ -309,15 +309,15 @@ PerlIOWin32_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *params, int flags)
{
PerlIOWin32 *os = PerlIOSelf(f,PerlIOWin32);
HANDLE proc = GetCurrentProcess();
- HANDLE new;
+ HANDLE new;
if (DuplicateHandle(proc, os->h, proc, &new, 0, FALSE, DUPLICATE_SAME_ACCESS))
{
char mode[8];
int fd = win32_open_osfhandle((intptr_t) new, PerlIOUnix_oflags(PerlIO_modestr(o,mode)));
- if (fd >= 0)
+ if (fd >= 0)
{
f = PerlIOBase_dup(aTHX_ f, o, params, flags);
- if (f)
+ if (f)
{
PerlIOWin32 *fs = PerlIOSelf(f,PerlIOWin32);
fs->h = new;
@@ -347,6 +347,7 @@ PerlIO_funcs PerlIO_win32 = {
PerlIOWin32_pushed,
PerlIOWin32_popped,
PerlIOWin32_open,
+ PerlIOBase_binmode,
NULL, /* getarg */
PerlIOWin32_fileno,
PerlIOWin32_dup,