2002-02-09 09:40:28 +01:00
|
|
|
--- ada/g-os_lib.adb.orig Fri Feb 1 23:18:26 2002
|
|
|
|
+++ ada/g-os_lib.adb Fri Feb 1 23:22:08 2002
|
|
|
|
@@ -192,26 +192,13 @@
|
2000-11-01 19:57:03 +01:00
|
|
|
(FD : out File_Descriptor;
|
|
|
|
Name : out Temp_File_Name)
|
|
|
|
is
|
|
|
|
- function Get_Temp_Name (T : Address) return Address;
|
|
|
|
- pragma Import (C, Get_Temp_Name, "mktemp");
|
|
|
|
-
|
|
|
|
- function Open_New_Temp
|
|
|
|
- (Name : System.Address;
|
|
|
|
- Fmode : Mode)
|
|
|
|
- return File_Descriptor;
|
|
|
|
- pragma Import (C, Open_New_Temp, "open_new_temp");
|
|
|
|
+ function Open_New_Temp (T : Address) return File_Descriptor;
|
|
|
|
+ pragma Import (C, Open_New_Temp, "mkstemp");
|
|
|
|
|
|
|
|
begin
|
2002-02-09 09:40:28 +01:00
|
|
|
Name (1 .. Temp_File_Len - 1) := "GNAT-XXXXXX";
|
|
|
|
Name (Temp_File_Len) := ASCII.NUL;
|
2000-11-01 19:57:03 +01:00
|
|
|
-
|
|
|
|
- -- Check for NULL pointer returned by C
|
|
|
|
-
|
|
|
|
- if Get_Temp_Name (Name'Address) = Null_Address then
|
|
|
|
- FD := -1;
|
|
|
|
- else
|
|
|
|
- FD := Open_New_Temp (Name'Address, Binary);
|
|
|
|
- end if;
|
|
|
|
+ FD := Open_New_Temp (Name'Address);
|
|
|
|
end Create_Temp_File;
|
|
|
|
|
|
|
|
-----------------
|