ad309c29e3
PR: 34670 Submitted by: Joe Marcus Clarke <marcus@marcuscom.com>
32 lines
1 KiB
Text
32 lines
1 KiB
Text
--- 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 @@
|
|
(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
|
|
Name (1 .. Temp_File_Len - 1) := "GNAT-XXXXXX";
|
|
Name (Temp_File_Len) := ASCII.NUL;
|
|
-
|
|
- -- 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;
|
|
|
|
-----------------
|