summaryrefslogtreecommitdiff
path: root/ext/IO/IO.xs
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2000-11-12 21:30:04 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-11-13 00:01:39 +0000
commita6a714bd63c892b02b99c5d9a11e90c9a061423b (patch)
tree92858523c20ff9c109177b94ed754eb4261565bf /ext/IO/IO.xs
parentcfd73201012eb44f660e4e9beb308155e13fd1a2 (diff)
downloadperl-a6a714bd63c892b02b99c5d9a11e90c9a061423b.tar.gz
[ID 20001112.006] IO::Seekable::getpos doesn't check for fgetpos() failure
Message-Id: <E13v4hQ-0000mn-00@Bagpuss.unfortu.net> p4raw-id: //depot/perl@7662
Diffstat (limited to 'ext/IO/IO.xs')
-rw-r--r--ext/IO/IO.xs11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs
index 1b79cfd4c0..6da48dca15 100644
--- a/ext/IO/IO.xs
+++ b/ext/IO/IO.xs
@@ -142,12 +142,17 @@ fgetpos(handle)
CODE:
if (handle) {
Fpos_t pos;
+ if (
#ifdef PerlIO
- PerlIO_getpos(handle, &pos);
+ PerlIO_getpos(handle, &pos)
#else
- fgetpos(handle, &pos);
+ fgetpos(handle, &pos)
#endif
- ST(0) = sv_2mortal(newSVpv((char*)&pos, sizeof(Fpos_t)));
+ ) {
+ ST(0) = &PL_sv_undef;
+ } else {
+ ST(0) = sv_2mortal(newSVpv((char*)&pos, sizeof(Fpos_t)));
+ }
}
else {
ST(0) = &PL_sv_undef;