Browse Source

* fix SetFAttr (doWriteThrough not accepted in DosSetPathInfo for ilStandard) and improve compatibility with TP/BP for returned DosError in case of errors

git-svn-id: trunk@29666 -
Tomas Hajny 10 years ago
parent
commit
2eba9bc63e
1 changed files with 7 additions and 4 deletions
  1. 7 4
      rtl/os2/dos.pas

+ 7 - 4
rtl/os2/dos.pas

@@ -754,16 +754,19 @@ begin
   if RC = 0 then
   if RC = 0 then
    begin
    begin
     PathInfo.AttrFile := Attr;
     PathInfo.AttrFile := Attr;
-    RC := DosSetPathInfo (P, ilStandard, @PathInfo, SizeOf (PathInfo),
-                                                        doWriteThru);
+    RC := DosSetPathInfo (P, ilStandard, @PathInfo, SizeOf (PathInfo), 0);
     if RC <> 0 then
     if RC <> 0 then
-     OSErrorWatch (RC);
+     begin
+      OSErrorWatch (RC);
+      if Attr and VolumeID = VolumeID then
+       RC := 5; (* Align the returned error value to TP/BP *)
+     end;
    end
    end
   else
   else
    begin
    begin
     OSErrorWatch (RC);
     OSErrorWatch (RC);
     if FileRec (F).Name [0] = #0 then
     if FileRec (F).Name [0] = #0 then
-     DosError := 3; (* Align the returned error value to TP/BP *)
+     RC := 3; (* Align the returned error value to TP/BP *)
    end;
    end;
   DosError := integer (RC);
   DosError := integer (RC);
 end;
 end;