2011-05-12 Keith Marshall <keithmarshall@users.sourceforge.net>
+ Fix MinGW-Bug #3295526 (reported by Charles Wilson).
+
+ * src/pkgunst.cpp (sys/stat.h): #include it; we need it for...
+ (pkg_unlink): ...chmod( file, S_IWRITE ), emulating `rm -f' semantics.
+
+2011-05-12 Keith Marshall <keithmarshall@users.sourceforge.net>
+
Diagnose and aggressively retry failed download connections.
* src/debug.h (DEBUG_TRACE_INTERNET_REQUESTS): New macro; define it.
return retval;
}
+/* We want the following "unlink" function to emulate "rm -f"
+ * semantics; thus we need to ensure that each file we attempt
+ * to unlink is writeable. To do this, we call "chmod()" prior
+ * to "unlink()"; we need sys/stat.h for the S_IWRITE mode we
+ * are required to set.
+ */
+#include <sys/stat.h>
+
static __inline__ __attribute__((__always_inline__))
int pkg_unlink( const char *sysroot, const char *pathname )
{
dmh_printf( " %s: unlink file\n", filepath )
);
+ chmod( filepath, S_IWRITE );
if( ((retval = unlink( filepath )) != 0) && (errno != ENOENT) )
dmh_notify( DMH_WARNING, "%s:unlink failed; %s\n", filepath, strerror( errno ) );
}