|
From: <ba...@us...> - 2006-09-18 04:25:48
|
Revision: 378
http://svn.sourceforge.net/cadcdev/?rev=378&view=rev
Author: bardtx
Date: 2006-09-17 21:25:42 -0700 (Sun, 17 Sep 2006)
Log Message:
-----------
dcload: Apply Patch #1279622 from SourceForge, for both dcloads:
Fixes link errors using a libbfd from binutils 2.16.1
Modified Paths:
--------------
dcload/dcload-ip/host-src/tool/Makefile
dcload/dcload-serial/host-src/tool/Makefile
Added Paths:
-----------
dcload/dcload-ip/host-src/tool/unlink.c
dcload/dcload-serial/host-src/tool/unlink.c
Modified: dcload/dcload-ip/host-src/tool/Makefile
===================================================================
--- dcload/dcload-ip/host-src/tool/Makefile 2006-09-18 04:19:51 UTC (rev 377)
+++ dcload/dcload-ip/host-src/tool/Makefile 2006-09-18 04:25:42 UTC (rev 378)
@@ -6,7 +6,7 @@
DCTOOL = dc-tool$(EXECUTABLEEXTENSION)
-OBJECTS = dc-tool.o syscalls.o
+OBJECTS = dc-tool.o syscalls.o unlink.o
.c.o:
$(CC) $(CFLAGS) $(INCLUDE) -o $@ -c $<
Added: dcload/dcload-ip/host-src/tool/unlink.c
===================================================================
--- dcload/dcload-ip/host-src/tool/unlink.c (rev 0)
+++ dcload/dcload-ip/host-src/tool/unlink.c 2006-09-18 04:25:42 UTC (rev 378)
@@ -0,0 +1,24 @@
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#ifndef S_ISLNK
+#ifdef S_IFLNK
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#else
+#define S_ISLNK(m) 0
+#define lstat stat
+#endif
+#endif
+
+int
+unlink_if_ordinary (const char *name)
+{
+ struct stat st;
+
+ if (lstat (name, &st) == 0
+ && (S_ISREG (st.st_mode) || S_ISLNK (st.st_mode)))
+ return unlink (name);
+
+ return 1;
+}
Modified: dcload/dcload-serial/host-src/tool/Makefile
===================================================================
--- dcload/dcload-serial/host-src/tool/Makefile 2006-09-18 04:19:51 UTC (rev 377)
+++ dcload/dcload-serial/host-src/tool/Makefile 2006-09-18 04:25:42 UTC (rev 378)
@@ -8,7 +8,7 @@
DCTOOL = dc-tool$(EXECUTABLEEXTENSION)
-OBJECTS = dc-tool.o minilzo.o syscalls.o
+OBJECTS = dc-tool.o minilzo.o syscalls.o unlink.o
LZOFILES = $(LZOPATH)/minilzo.c $(LZOPATH)/minilzo.h $(LZOPATH)/lzoconf.h
.c.o:
Added: dcload/dcload-serial/host-src/tool/unlink.c
===================================================================
--- dcload/dcload-serial/host-src/tool/unlink.c (rev 0)
+++ dcload/dcload-serial/host-src/tool/unlink.c 2006-09-18 04:25:42 UTC (rev 378)
@@ -0,0 +1,24 @@
+#include <sys/types.h>
+#include <unistd.h>
+#include <sys/stat.h>
+
+#ifndef S_ISLNK
+#ifdef S_IFLNK
+#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
+#else
+#define S_ISLNK(m) 0
+#define lstat stat
+#endif
+#endif
+
+int
+unlink_if_ordinary (const char *name)
+{
+ struct stat st;
+
+ if (lstat (name, &st) == 0
+ && (S_ISREG (st.st_mode) || S_ISLNK (st.st_mode)))
+ return unlink (name);
+
+ return 1;
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|