[llvm-commits] [llvm-gcc-4.2] r54153 - in /llvm-gcc-4.2/trunk/libiberty: make-temp-file.c pex-unix.c
Bill Wendling
isanbard at gmail.com
Tue Jul 29 01:14:10 PDT 2008
Author: void
Date: Tue Jul 29 03:14:09 2008
New Revision: 54153
URL: http://llvm.org/viewvc/llvm-project?rev=54153&view=rev
Log:
Update to GCC 4.2 TOT from r142930.
Modified:
llvm-gcc-4.2/trunk/libiberty/make-temp-file.c
llvm-gcc-4.2/trunk/libiberty/pex-unix.c
Modified: llvm-gcc-4.2/trunk/libiberty/make-temp-file.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libiberty/make-temp-file.c?rev=54153&r1=54152&r2=54153&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/libiberty/make-temp-file.c (original)
+++ llvm-gcc-4.2/trunk/libiberty/make-temp-file.c Tue Jul 29 03:14:09 2008
@@ -35,6 +35,12 @@
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h> /* May get R_OK, etc. on some systems. */
#endif
+/* APPLE LOCAL begin mainline candidate */
+#include <errno.h>
+#ifdef NEED_DECLARATION_ERRNO
+extern int errno;
+#endif
+/* APPLE LOCAL end mainline candidate */
#ifndef R_OK
#define R_OK 4
@@ -166,12 +172,21 @@
strcpy (temp_filename + base_len + TEMP_FILE_LEN, suffix);
fd = mkstemps (temp_filename, suffix_len);
- /* If mkstemps failed, then something bad is happening. Maybe we should
- issue a message about a possible security attack in progress? */
+
+ /* APPLE LOCAL begin mainline candidate */
+ /* If mkstemps failed something bad is happening, send an error message
+ and exit. */
if (fd == -1)
- abort ();
+ {
+ fprintf (stderr, "Failed to open temp file in %s, error: %s\n", base, xstrerror(errno));
+ xexit (1);
+ }
/* Similarly if we can not close the file. */
if (close (fd))
- abort ();
+ {
+ fprintf (stderr, "Failed to close temp file in %s, error: %s\n", base, xstrerror(errno));
+ xexit (1);
+ }
+ /* APPLE LOCAL end mainline candidate */
return temp_filename;
}
Modified: llvm-gcc-4.2/trunk/libiberty/pex-unix.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/libiberty/pex-unix.c?rev=54153&r1=54152&r2=54153&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/libiberty/pex-unix.c (original)
+++ llvm-gcc-4.2/trunk/libiberty/pex-unix.c Tue Jul 29 03:14:09 2008
@@ -84,21 +84,15 @@
time that it took. This is simple if we have wait4, slightly
harder if we have waitpid, and is a pain if we only have wait. */
-/* LLVM LOCAL begin mainline */
static pid_t pex_wait (struct pex_obj *, pid_t, int *, struct pex_time *);
-/* LLVM LOCAL end mainline */
#ifdef HAVE_WAIT4
-/* LLVM LOCAL begin mainline */
static pid_t
pex_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status,
-/* LLVM LOCAL end mainline */
struct pex_time *time)
{
- /* LLVM LOCAL begin mainline */
pid_t ret;
- /* LLVM LOCAL end mainline */
struct rusage r;
#ifdef HAVE_WAITPID
@@ -125,10 +119,8 @@
#ifndef HAVE_GETRUSAGE
-/* LLVM LOCAL begin mainline */
static pid_t
pex_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status,
-/* LLVM LOCAL end mainline */
struct pex_time *time)
{
if (time != NULL)
@@ -138,16 +130,12 @@
#else /* defined (HAVE_GETRUSAGE) */
-/* LLVM LOCAL begin mainline */
static pid_t
pex_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid, int *status,
-/* LLVM LOCAL end mainline */
struct pex_time *time)
{
struct rusage r1, r2;
- /* LLVM LOCAL begin mainline */
pid_t ret;
- /* LLVM LOCAL end mainline */
if (time == NULL)
return waitpid (pid, status, 0);
@@ -186,17 +174,13 @@
struct status_list
{
struct status_list *next;
- /* LLVM LOCAL begin mainline */
pid_t pid;
- /* LLVM LOCAL end mainline */
int status;
struct pex_time time;
};
-/* LLVM LOCAL begin mainline */
static pid_t
pex_wait (struct pex_obj *obj, pid_t pid, int *status, struct pex_time *time)
-/* LLVM LOCAL end mainline */
{
struct status_list **pp;
@@ -220,9 +204,7 @@
while (1)
{
- /* LLVM LOCAL begin mainline */
pid_t cpid;
- /* LLVM LOCAL end mainline */
struct status_list *psl;
struct pex_time pt;
#ifdef HAVE_GETRUSAGE
@@ -385,9 +367,7 @@
int in, int out, int errdes,
int toclose, const char **errmsg, int *err)
{
- /* LLVM LOCAL begin mainline */
pid_t pid;
- /* LLVM LOCAL end mainline */
/* We declare these to be volatile to avoid warnings from gcc about
them being clobbered by vfork. */
More information about the llvm-commits
mailing list