Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5199 → Rev 5217

/contrib/toolchain/binutils/libiberty/Makefile
16,7 → 16,7
fopen_unlocked.c getopt.c getopt1.c getpwd.c \
getruntime.c hashtab.c hex.c index.c insque.c \
lbasename.c lrealpath.c make-relative-prefix.c \
make-temp-file.c md5.c memmem.c mempcpy.c mkstemps.c \
make-temp-file.c md5.c memmem.c mempcpy.c \
objalloc.c obstack.c partition.c physmem.c random.c \
regex.c rindex.c safe-ctype.c setenv.c setproctitle.c \
sha1.c sigsetmask.c simple-object.c simple-object-coff.c\
/contrib/toolchain/binutils/libiberty/config.h
165,7 → 165,7
#define HAVE_MEMSET 1
 
/* Define to 1 if you have the `mkstemps' function. */
/* #undef HAVE_MKSTEMPS */
#define HAVE_MKSTEMPS 1
 
/* Define to 1 if you have a working `mmap' system call. */
/* #undef HAVE_MMAP */
/contrib/toolchain/binutils/libiberty/make-temp-file.c
89,7 → 89,7
 
#endif
 
static char *memoized_tmpdir;
//static char *memoized_tmpdir;
 
/*
 
105,70 → 105,9
char *
choose_tmpdir (void)
{
if (!memoized_tmpdir)
{
#if !defined(_WIN32) || defined(__CYGWIN__)
const char *base = 0;
char *tmpdir;
unsigned int len;
#ifdef VMS
/* Try VMS standard temp logical. */
base = try_dir ("/sys$scratch", base);
#else
base = try_dir (getenv ("TMPDIR"), base);
base = try_dir (getenv ("TMP"), base);
base = try_dir (getenv ("TEMP"), base);
#endif
#ifdef P_tmpdir
/* We really want a directory name here as if concatenated with say \dir
we do not end up with a double \\ which defines an UNC path. */
if (strcmp (P_tmpdir, "\\") == 0)
base = try_dir ("\\.", base);
else
base = try_dir (P_tmpdir, base);
#endif
 
/* Try /var/tmp, /usr/tmp, then /tmp. */
base = try_dir (vartmp, base);
base = try_dir (usrtmp, base);
base = try_dir (tmp, base);
/* If all else fails, use the current directory! */
if (base == 0)
base = ".";
/* Append DIR_SEPARATOR to the directory we've chosen
and return it. */
len = strlen (base);
tmpdir = XNEWVEC (char, len + 2);
strcpy (tmpdir, base);
tmpdir[len] = DIR_SEPARATOR;
tmpdir[len+1] = '\0';
memoized_tmpdir = tmpdir;
#else /* defined(_WIN32) && !defined(__CYGWIN__) */
DWORD len;
 
/* Figure out how much space we need. */
len = GetTempPath(0, NULL);
if (len)
{
memoized_tmpdir = XNEWVEC (char, len);
if (!GetTempPath(len, memoized_tmpdir))
{
XDELETEVEC (memoized_tmpdir);
memoized_tmpdir = NULL;
return "/tmp0/1/";
}
}
if (!memoized_tmpdir)
/* If all else fails, use the current directory. */
memoized_tmpdir = xstrdup (".\\");
#endif /* defined(_WIN32) && !defined(__CYGWIN__) */
}
 
return memoized_tmpdir;
}
 
/*
 
@deftypefn Replacement char* make_temp_file (const char *@var{suffix})
/contrib/toolchain/binutils/libiberty/mkstemps.c
100,9 → 100,9
#ifdef HAVE_GETTIMEOFDAY
/* Get some more or less random data. */
gettimeofday (&tv, NULL);
value += ((gcc_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid ();
value += ((gcc_uint64_t) tv.tv_usec << 16) ^ tv.tv_sec; // ^ getpid ();
#else
value += getpid ();
value += 1;//getpid ();
#endif
 
for (count = 0; count < TMP_MAX; ++count)
/contrib/toolchain/binutils/libiberty/unlink-if-ordinary.c
64,9 → 64,9
{
struct stat st;
 
// if (lstat (name, &st) == 0
// && (S_ISREG (st.st_mode) || S_ISLNK (st.st_mode)))
// return unlink (name);
if (lstat (name, &st) == 0
&& (S_ISREG (st.st_mode) || S_ISLNK (st.st_mode)))
return unlink (name);
 
return 1;
}