summaryrefslogtreecommitdiff
path: root/ext/PerlIO/Via/Via.xs
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2001-10-16 19:11:30 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2001-10-16 19:11:30 +0000
commit9f16d962dace601f24c23063432e8a8eb01bfa4a (patch)
tree38c1c77401f4ff3c6b548891cb4f63eb3c02c55e /ext/PerlIO/Via/Via.xs
parentb77c74bc90789599ae69b0d39a1984d2768fa05e (diff)
downloadperl-9f16d962dace601f24c23063432e8a8eb01bfa4a.tar.gz
PerlIOXxxx_dups for all but Win32
p4raw-id: //depot/perlio@12462
Diffstat (limited to 'ext/PerlIO/Via/Via.xs')
-rw-r--r--ext/PerlIO/Via/Via.xs14
1 files changed, 9 insertions, 5 deletions
diff --git a/ext/PerlIO/Via/Via.xs b/ext/PerlIO/Via/Via.xs
index 2e029dbded..adf0abfd78 100644
--- a/ext/PerlIO/Via/Via.xs
+++ b/ext/PerlIO/Via/Via.xs
@@ -13,7 +13,6 @@ typedef struct
SV * obj;
SV * var;
SSize_t cnt;
- Off_t posn;
IO * io;
SV * fh;
CV *PUSHED;
@@ -270,7 +269,7 @@ PerlIOVia_seek(PerlIO *f, Off_t offset, int whence)
dTHX;
PerlIOVia *s = PerlIOSelf(f,PerlIOVia);
SV *offsv = sv_2mortal(newSViv(offset));
- SV *whsv = sv_2mortal(newSViv(offset));
+ SV *whsv = sv_2mortal(newSViv(whence));
SV *result = PerlIOVia_method(aTHX_ f,MYMethod(SEEK),G_SCALAR,offsv,whsv,Nullsv);
return (result) ? SvIV(result) : -1;
}
@@ -281,7 +280,7 @@ PerlIOVia_tell(PerlIO *f)
dTHX;
PerlIOVia *s = PerlIOSelf(f,PerlIOVia);
SV *result = PerlIOVia_method(aTHX_ f,MYMethod(TELL),G_SCALAR,Nullsv);
- return (result) ? (Off_t) SvIV(result) : s->posn;
+ return (result) ? (Off_t) SvIV(result) : (Off_t) -1;
}
SSize_t
@@ -494,8 +493,13 @@ PerlIOVia_eof(PerlIO *f)
PerlIO *
PerlIOVia_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param)
{
- /* FIXME - Needs more work */
- return PerlIOBase_dup(aTHX_ f, o, param);
+ if ((f = PerlIOBase_dup(aTHX_ f, o, param)))
+ {
+ /* Most of the fields will lazily set them selves up as needed
+ stash and obj have been set up by the implied push
+ */
+ }
+ return f;
}
PerlIO_funcs PerlIO_object = {