瀏覽代碼

* fix bug report 2086

pierre 23 年之前
父節點
當前提交
521f29fcca
共有 1 個文件被更改,包括 11 次插入2 次删除
  1. 11 2
      rtl/win32/system.pp

+ 11 - 2
rtl/win32/system.pp

@@ -174,6 +174,9 @@ CONST
 {  The process cannot access the file because         }
 {  The process cannot access the file because         }
 {  it is being used by another process.               }
 {  it is being used by another process.               }
     ERROR_SHARING_VIOLATION      =   32;
     ERROR_SHARING_VIOLATION      =   32;
+{   A pipe has been closed on the other end }
+{   Removing that error allows eof to works as on other OSes }
+    ERROR_BROKEN_PIPE = 109;
 
 
 {$IFDEF MT}
 {$IFDEF MT}
 threadvar
 threadvar
@@ -424,7 +427,10 @@ begin
   if readfile(h,pointer(addr),len,_result,nil)=0 then
   if readfile(h,pointer(addr),len,_result,nil)=0 then
     Begin
     Begin
       errno:=GetLastError;
       errno:=GetLastError;
-      Errno2InoutRes;
+      if errno=ERROR_BROKEN_PIPE then
+        errno:=0
+      else
+        Errno2InoutRes;
     end;
     end;
   do_read:=_result;
   do_read:=_result;
 end;
 end;
@@ -1567,7 +1573,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.29  2002-07-28 20:43:49  florian
+  Revision 1.30  2002-08-26 13:49:18  pierre
+   * fix bug report 2086
+
+  Revision 1.29  2002/07/28 20:43:49  florian
     * several fixes for linux/powerpc
     * several fixes for linux/powerpc
     * several fixes to MT
     * several fixes to MT