Permalink
Browse files

Incorporated feedback from Shmuel Zeigerman sent in May 2009 that I n…

…ever

got around to incorporating into the source.
  • Loading branch information...
1 parent d7b30b4 commit 523a4b53b34970014ee63087cd5bc04502920658 @bji bji committed Sep 28, 2011
Showing with 9 additions and 4 deletions.
  1. +2 −1 GNUmakefile.mingw
  2. +7 −3 src/s3.c
View
@@ -130,7 +130,8 @@ CFLAGS += -Wall -Werror -Wshadow -Wextra -Iinc \
-D__STRICT_ANSI__ \
-D_ISOC99_SOURCE \
-D_POSIX_C_SOURCE=200112L \
- -Dsleep=Sleep -DFOPEN_EXTRA_FLAGS=\"b\" \
+ -Dsleep=Sleep -DSLEEP_UNITS_PER_SECOND=1000 \
+ -DFOPEN_EXTRA_FLAGS=\"b\" \
-Iinc/mingw -include windows.h
LDFLAGS = $(CURL_LIBS) $(LIBXML2_LIBS)
View
@@ -46,6 +46,11 @@
#define FOPEN_EXTRA_FLAGS ""
#endif
+// Some Unix stuff (to work around Windows issues)
+#ifndef SLEEP_UNITS_PER_SECOND
+#define SLEEP_UNITS_PER_SECOND 1
+#endif
+
// Also needed for Windows, because somehow MinGW doesn't define this
extern int putenv(char *);
@@ -667,12 +672,11 @@ static int convert_simple_acl(char *aclXml, char *ownerId,
return 1;
}
-
static int should_retry()
{
if (retriesG--) {
// Sleep before next retry; start out with a 1 second sleep
- static int retrySleepInterval = 1;
+ static int retrySleepInterval = 1 * SLEEP_UNITS_PER_SECOND;
sleep(retrySleepInterval);
// Next sleep 1 second longer
retrySleepInterval++;
@@ -1220,7 +1224,6 @@ static void list_bucket(const char *bucketName, const char *prefix,
if (statusG != S3StatusOK) {
break;
}
- marker = data.nextMarker;
} while (data.isTruncated && (!maxkeys || (data.keyCount < maxkeys)));
if (statusG == S3StatusOK) {
@@ -2663,6 +2666,7 @@ int main(int argc, char **argv)
break;
case 'r': {
const char *v = optarg;
+ retriesG = 0;
while (*v) {
retriesG *= 10;
retriesG += *v - '0';

0 comments on commit 523a4b5

Please sign in to comment.