2
0
Эх сурвалжийг харах

* fixed inoutres for diskfull

peter 26 жил өмнө
parent
commit
c3a8983799
2 өөрчлөгдсөн 20 нэмэгдсэн , 7 устгасан
  1. 6 3
      rtl/inc/file.inc
  2. 14 4
      rtl/inc/text.inc

+ 6 - 3
rtl/inc/file.inc

@@ -176,7 +176,7 @@ var
   Result : Longint;
 Begin
   BlockWrite(f,Buf,Count,Result);
-  If (Result=0) and (Count>0) Then
+  If (Result<Count) and (Count>0) Then
    InOutRes:=101;
 End;
 
@@ -237,7 +237,7 @@ var
   Result : Longint;
 Begin
   BlockRead(f,Buf,Count,Result);
-  If (Result=0) and (Count>0) Then
+  If (Result<Count) and (Count>0) Then
    InOutRes:=100;
 End;
 
@@ -415,7 +415,10 @@ End;
 
 {
   $Log$
-  Revision 1.11  1999-09-07 15:54:18  hajny
+  Revision 1.12  1999-09-08 16:12:24  peter
+    * fixed inoutres for diskfull
+
+  Revision 1.11  1999/09/07 15:54:18  hajny
     * fixed problem with Close under OS/2
 
   Revision 1.10  1998/11/29 23:10:12  peter

+ 14 - 4
rtl/inc/text.inc

@@ -41,8 +41,12 @@ End;
 
 
 Procedure FileWriteFunc(var t:TextRec);
+var
+  i : longint;
 Begin
-  Do_Write(t.Handle,Longint(t.Bufptr),t.BufPos);
+  i:=Do_Write(t.Handle,Longint(t.Bufptr),t.BufPos);
+  if i<>t.BufPos then
+   InOutRes:=101;
   t.BufPos:=0;
 End;
 
@@ -69,8 +73,11 @@ Begin
   else
    begin
      t.InOutFunc:=@FileWriteFunc;
-   { Only install flushing if its a NOT a file }
-     if Do_Isdevice(t.Handle) then
+   { Only install flushing if its a NOT a file, and only check if there
+     was no error opening the file, becuase else we always get a bad
+     file handle error 6 (PFV) }
+     if (InOutRes=0) and
+        Do_Isdevice(t.Handle) then
       t.FlushFunc:=@FileWriteFunc;
    end;
 End;
@@ -945,7 +952,10 @@ end;
 
 {
   $Log$
-  Revision 1.54  1999-09-07 07:44:58  peter
+  Revision 1.55  1999-09-08 16:12:24  peter
+    * fixed inoutres for diskfull
+
+  Revision 1.54  1999/09/07 07:44:58  peter
     * fixed array of char writing which didn't write the last char
 
   Revision 1.53  1999/08/19 11:16:14  peter