Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5198 → Rev 5199

/contrib/toolchain/binutils/libiberty/Makefile
36,7 → 36,7
 
libiberty.a : $(OBJS) MAkefile
$(AR) crs libiberty.a $(OBJS)
# mv -f libiberty.a $(SDK_DIR)/lib
mv -f libiberty.a $(SDK_DIR)/lib
 
%.o : %.c Makefile
$(CC) $(CFLAGS) $(DEFINES) $(INCLUDES) -o $@ $<
/contrib/toolchain/binutils/libiberty/getpwd.c
41,16 → 41,7
 
#include "libiberty.h"
 
/* Virtually every UN*X system now in common use (except for pre-4.3-tahoe
BSD systems) now provides getcwd as called for by POSIX. Allow for
the few exceptions to the general rule here. */
 
#if !defined(HAVE_GETCWD) && defined(HAVE_GETWD)
/* Prototype in case the system headers doesn't provide it. */
extern char *getwd ();
#define getcwd(buf,len) getwd(buf)
#endif
 
#ifdef MAXPATHLEN
#define GUESSPATHLEN (MAXPATHLEN + 1)
#else
57,60 → 48,23
#define GUESSPATHLEN 100
#endif
 
#if !(defined (VMS) || (defined(_WIN32) && !defined(__CYGWIN__)))
#ifndef MAXPATHLEN
#define MAXPATHLEN 255
#endif
 
/* Get the working directory. Use the PWD environment variable if it's
set correctly, since this is faster and gives more uniform answers
to the user. Yield the working directory if successful; otherwise,
yield 0 and set errno. */
 
char *
getpwd (void)
static char *getccwd(char *buf, size_t size)
{
static char *pwd;
static int failure_errno;
int bsize;
__asm__ __volatile__(
"int $0x40"
:"=a"(bsize)
:"a"(30),"b"(2),"c"(buf), "d"(size)
:"memory");
 
char *p = pwd;
size_t s;
struct stat dotstat, pwdstat;
return buf;
};
 
if (!p && !(errno = failure_errno))
{
if (! ((p = getenv ("PWD")) != 0
&& *p == '/'
&& stat (p, &pwdstat) == 0
&& stat (".", &dotstat) == 0
&& dotstat.st_ino == pwdstat.st_ino
&& dotstat.st_dev == pwdstat.st_dev))
 
/* The shortcut didn't work. Try the slow, ``sure'' way. */
for (s = GUESSPATHLEN; !getcwd (p = XNEWVEC (char, s), s); s *= 2)
{
int e = errno;
free (p);
#ifdef ERANGE
if (e != ERANGE)
#endif
{
errno = failure_errno = e;
p = 0;
break;
}
}
 
/* Cache the result. This assumes that the program does
not invoke chdir between calls to getpwd. */
pwd = p;
}
return p;
}
 
#else /* VMS || _WIN32 && !__CYGWIN__ */
 
#ifndef MAXPATHLEN
#define MAXPATHLEN 255
#endif
 
char *
getpwd (void)
{
117,12 → 71,9
static char *pwd = 0;
 
if (!pwd)
pwd = getcwd (XNEWVEC (char, MAXPATHLEN + 1), MAXPATHLEN + 1
#ifdef VMS
, 0
#endif
);
pwd = getccwd (XNEWVEC (char, MAXPATHLEN + 1), MAXPATHLEN + 1);
 
return pwd;
}
 
#endif /* VMS || _WIN32 && !__CYGWIN__ */
 
/contrib/toolchain/binutils/libiberty/make-relative-prefix.c
243,7 → 243,9
{
char *temp;
 
#if 0
temp = getenv ("PATH");
 
if (temp)
{
char *startp, *endp, *nstore;
305,6 → 307,8
endp++;
}
}
#endif
 
}
 
if (resolve_links)
/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;
}