aboutsummaryrefslogtreecommitdiff
path: root/libiberty/simple-object.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-04-07 20:41:49 +0930
committerAlan Modra <amodra@gmail.com>2019-04-07 20:49:49 +0930
commit07ffcfecac22d21774a110db0f65f0387c8f1102 (patch)
tree120cc0b18f95144c1b03367a36ba6753db81e777 /libiberty/simple-object.c
parent5f60cccf9db8b5f4aa4303f8e4ccc246f723fbe5 (diff)
downloadgdb-07ffcfecac22d21774a110db0f65f0387c8f1102.zip
gdb-07ffcfecac22d21774a110db0f65f0387c8f1102.tar.gz
gdb-07ffcfecac22d21774a110db0f65f0387c8f1102.tar.bz2
Merge libiberty from gcc
Diffstat (limited to 'libiberty/simple-object.c')
-rw-r--r--libiberty/simple-object.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libiberty/simple-object.c b/libiberty/simple-object.c
index c1f38ce..b00c265 100644
--- a/libiberty/simple-object.c
+++ b/libiberty/simple-object.c
@@ -44,6 +44,10 @@ Boston, MA 02110-1301, USA. */
#define SEEK_SET 0
#endif
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
#include "simple-object-common.h"
/* The known object file formats. */
@@ -349,7 +353,7 @@ simple_object_copy_lto_debug_sections (simple_object_read *sobj,
return errmsg;
}
- outfd = creat (dest, 00777);
+ outfd = open (dest, O_CREAT|O_WRONLY|O_TRUNC|O_BINARY, 00777);
if (outfd == -1)
{
*err = errno;