mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-23 08:11:59 +01:00
* fixed setting EInoutError.ErrorCode (mantis #12575, thanks to
Bart Broersma for the analysis) git-svn-id: trunk@12037 -
This commit is contained in:
parent
718694d1d6
commit
dbbd75ca47
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8613,6 +8613,7 @@ tests/webtbs/tw1250.pp svneol=native#text/plain
|
|||||||
tests/webtbs/tw12508a.pp svneol=native#text/plain
|
tests/webtbs/tw12508a.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1251b.pp svneol=native#text/plain
|
tests/webtbs/tw1251b.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1255.pp svneol=native#text/plain
|
tests/webtbs/tw1255.pp svneol=native#text/plain
|
||||||
|
tests/webtbs/tw12575.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1269.pp svneol=native#text/plain
|
tests/webtbs/tw1269.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1275.pp svneol=native#text/plain
|
tests/webtbs/tw1275.pp svneol=native#text/plain
|
||||||
tests/webtbs/tw1279.pp svneol=native#text/plain
|
tests/webtbs/tw1279.pp svneol=native#text/plain
|
||||||
|
|||||||
@ -284,7 +284,14 @@ begin
|
|||||||
106 : HS:=@SInvalidInput;
|
106 : HS:=@SInvalidInput;
|
||||||
end;
|
end;
|
||||||
E:=EinOutError.Create (HS^);
|
E:=EinOutError.Create (HS^);
|
||||||
EInoutError(E).ErrorCode:=IOresult; // Clears InOutRes !!
|
// this routine can be called from FPC_IOCHECK,
|
||||||
|
// which clears inoutres and then passes its
|
||||||
|
// original value to HandleErrorFrame() (which calls
|
||||||
|
// us). So use errno rather than IOResult, and clear
|
||||||
|
// InOutRes explicitly in case we can also be called
|
||||||
|
// from a place that does not clear InOutRes explicitly
|
||||||
|
EInoutError(E).ErrorCode:=errno;
|
||||||
|
inoutres:=0;
|
||||||
end;
|
end;
|
||||||
// We don't set abstracterrorhandler, but we do it here.
|
// We don't set abstracterrorhandler, but we do it here.
|
||||||
// Unless the use sets another handler we'll get here anyway...
|
// Unless the use sets another handler we'll get here anyway...
|
||||||
|
|||||||
17
tests/webtbs/tw12575.pp
Normal file
17
tests/webtbs/tw12575.pp
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{$mode objfpc}
|
||||||
|
PROGRAM Test;
|
||||||
|
USES SysUtils;
|
||||||
|
|
||||||
|
VAR
|
||||||
|
t : Text;
|
||||||
|
|
||||||
|
BEGIN
|
||||||
|
Assign(t, 'blah.txt');
|
||||||
|
TRY
|
||||||
|
Close(t);
|
||||||
|
EXCEPT
|
||||||
|
ON e: EInOutError DO
|
||||||
|
if (e.ErrorCode <> 103) then
|
||||||
|
halt(1);
|
||||||
|
END;
|
||||||
|
END.
|
||||||
Loading…
Reference in New Issue
Block a user