summaryrefslogtreecommitdiff
path: root/rtl/aix
diff options
context:
space:
mode:
authorhajny <hajny@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-09-13 22:08:18 +0000
committerhajny <hajny@3ad0048d-3df7-0310-abae-a5850022a9f2>2020-09-13 22:08:18 +0000
commit43137807682241bf79eb457764f985ee7d1116b7 (patch)
tree5b92dd3a6c88c02ae064c48a4395d3423d09e4af /rtl/aix
parent9e93a76dc642c7c9771994711717885178bdfc29 (diff)
downloadfpc-43137807682241bf79eb457764f985ee7d1116b7.tar.gz
* Do_IsDevice treats pipes and sockets the same way as character devices
git-svn-id: https://svn.freepascal.org/svn/fpc/trunk@46863 3ad0048d-3df7-0310-abae-a5850022a9f2
Diffstat (limited to 'rtl/aix')
-rw-r--r--rtl/aix/sysos.inc11
1 files changed, 8 insertions, 3 deletions
diff --git a/rtl/aix/sysos.inc b/rtl/aix/sysos.inc
index 5c40166db6..2923cee4b1 100644
--- a/rtl/aix/sysos.inc
+++ b/rtl/aix/sysos.inc
@@ -96,10 +96,15 @@ end;
*****************************************************************************}
function do_isdevice(handle:longint):boolean;
+var
+ StatRec: Stat;
begin
- do_isdevice:= (handle=StdInputHandle) or
- (handle=StdOutputHandle) or
- (handle=StdErrorHandle);
+ fpFStat (Handle, StatRec);
+ case StatRec.st_Mode and S_IFMT of
+ S_IFCHR, S_IFIFO, S_IFSOCK: Do_IsDevice := true
+ else
+ Do_IsDevice := false;
+ end;
end;