Bläddra i källkod

* 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 år sedan
förälder
incheckning
2eba9bc63e
1 ändrade filer med 7 tillägg och 4 borttagningar
  1. 7 4
      rtl/os2/dos.pas

+ 7 - 4
rtl/os2/dos.pas

@@ -754,16 +754,19 @@ begin
   if RC = 0 then
    begin
     PathInfo.AttrFile := Attr;
-    RC := DosSetPathInfo (P, ilStandard, @PathInfo, SizeOf (PathInfo),
-                                                        doWriteThru);
+    RC := DosSetPathInfo (P, ilStandard, @PathInfo, SizeOf (PathInfo), 0);
     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
   else
    begin
     OSErrorWatch (RC);
     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;
   DosError := integer (RC);
 end;