summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2014-05-16 07:33:11 -0700
committerSage Weil <sage@inktank.com>2014-05-16 07:33:11 -0700
commitdcf98ff04bc5dacd5d45854a32870d86dd7b26c7 (patch)
tree5af6c5d2544bc070975479fe926807df5c7634be
parent9dc3a9c683385abfe4ad92b7c6ff30719acc3c13 (diff)
parent2f602bce782be221a729a74df1258fdf896e633b (diff)
downloadceph-libs3-master.tar.gz
Merge pull request #2 from ceph/wip-da-SCAHEADmaster
Some fixes from SCA runs Reviewed-by: Sage Weil <sage@inktank.com>
-rw-r--r--GNUmakefile19
-rw-r--r--inc/util.h2
-rw-r--r--src/general.c2
-rw-r--r--src/request.c2
-rw-r--r--src/s3.c8
5 files changed, 19 insertions, 14 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 7a74ec3..f387e30 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -91,6 +91,11 @@ ifndef DESTDIR
DESTDIR := /usr
endif
+# --------------------------------------------------------------------------
+# Compiler CC handling
+ifndef CC
+ CC := gcc
+endif
# --------------------------------------------------------------------------
# Acquire configuration information for libraries that libs3 depends upon
@@ -205,18 +210,18 @@ uninstall:
$(BUILD)/obj/%.o: src/%.c
$(QUIET_ECHO) $@: Compiling object
@ mkdir -p $(dir $(BUILD)/dep/$<)
- @ gcc $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
+ @ $(CC) $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
-o $(BUILD)/dep/$(<:%.c=%.d) -c $<
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc $(CFLAGS) -o $@ -c $<
+ $(VERBOSE_SHOW) $(CC) $(CFLAGS) -o $@ -c $<
$(BUILD)/obj/%.do: src/%.c
$(QUIET_ECHO) $@: Compiling dynamic object
@ mkdir -p $(dir $(BUILD)/dep/$<)
- @ gcc $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
+ @ $(CC) $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
-o $(BUILD)/dep/$(<:%.c=%.dd) -c $<
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc $(CFLAGS) -fpic -fPIC -o $@ -c $<
+ $(VERBOSE_SHOW) $(CC) $(CFLAGS) -fpic -fPIC -o $@ -c $<
# --------------------------------------------------------------------------
@@ -236,7 +241,7 @@ LIBS3_SOURCES := acl.c bucket.c error_parser.c general.c \
$(LIBS3_SHARED): $(LIBS3_SOURCES:%.c=$(BUILD)/obj/%.do)
$(QUIET_ECHO) $@: Building shared library
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc -shared -Wl,-soname,libs3.so.$(LIBS3_VER_MAJOR) \
+ $(VERBOSE_SHOW) $(CC) -shared -Wl,-soname,libs3.so.$(LIBS3_VER_MAJOR) \
-o $@ $^ $(LDFLAGS)
$(LIBS3_STATIC): $(LIBS3_SOURCES:%.c=$(BUILD)/obj/%.o)
@@ -254,7 +259,7 @@ s3: $(BUILD)/bin/s3
$(BUILD)/bin/s3: $(BUILD)/obj/s3.o $(LIBS3_SHARED)
$(QUIET_ECHO) $@: Building executable
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc -o $@ $^ $(LDFLAGS)
+ $(VERBOSE_SHOW) $(CC) -o $@ $^ $(LDFLAGS)
# --------------------------------------------------------------------------
@@ -278,7 +283,7 @@ test: $(BUILD)/bin/testsimplexml
$(BUILD)/bin/testsimplexml: $(BUILD)/obj/testsimplexml.o $(LIBS3_STATIC)
$(QUIET_ECHO) $@: Building executable
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc -o $@ $^ $(LIBXML2_LIBS)
+ $(VERBOSE_SHOW) $(CC) -o $@ $^ $(LIBXML2_LIBS)
# --------------------------------------------------------------------------
diff --git a/inc/util.h b/inc/util.h
index 4138ca7..94ed0e7 100644
--- a/inc/util.h
+++ b/inc/util.h
@@ -58,7 +58,7 @@
// 255 is the maximum bucket length
#define MAX_URI_SIZE \
((sizeof("https:///") - 1) + S3_MAX_HOSTNAME_SIZE + 255 + 1 + \
- MAX_URLENCODED_KEY_SIZE + (sizeof("?torrent" - 1)) + 1)
+ MAX_URLENCODED_KEY_SIZE + (sizeof("?torrent") - 1) + 1)
// Maximum size of a canonicalized resource
#define MAX_CANONICALIZED_RESOURCE_SIZE \
diff --git a/src/general.c b/src/general.c
index fb30c37..867ae5d 100644
--- a/src/general.c
+++ b/src/general.c
@@ -43,7 +43,7 @@ S3Status S3_initialize(const char *userAgentInfo, int flags,
}
-void S3_deinitialize()
+void S3_deinitialize(void)
{
if (--initializeCountG) {
return;
diff --git a/src/request.c b/src/request.c
index b267a5e..53bda41 100644
--- a/src/request.c
+++ b/src/request.c
@@ -1109,7 +1109,7 @@ S3Status request_api_initialize(const char *userAgentInfo, int flags,
}
-void request_api_deinitialize()
+void request_api_deinitialize(void)
{
pthread_mutex_destroy(&requestStackMutexG);
diff --git a/src/s3.c b/src/s3.c
index 65acc52..11f54af 100644
--- a/src/s3.c
+++ b/src/s3.c
@@ -141,7 +141,7 @@ static char putenvBufG[256];
// util ----------------------------------------------------------------------
-static void S3_init()
+static void S3_init(void)
{
S3Status status;
const char *hostname = getenv("S3_HOSTNAME");
@@ -155,7 +155,7 @@ static void S3_init()
}
-static void printError()
+static void printError(void)
{
if (statusG < S3StatusErrorAccessDenied) {
fprintf(stderr, "\nERROR: %s\n", S3_get_status_name(statusG));
@@ -376,7 +376,7 @@ static int growbuffer_append(growbuffer **gb, const char *data, int dataLen)
}
buf->size = 0;
buf->start = 0;
- if (*gb) {
+ if (*gb && (*gb)->prev) {
buf->prev = (*gb)->prev;
buf->next = *gb;
(*gb)->prev->next = buf;
@@ -675,7 +675,7 @@ static int convert_simple_acl(char *aclXml, char *ownerId,
return 1;
}
-static int should_retry()
+static int should_retry(void)
{
if (retriesG--) {
// Sleep before next retry; start out with a 1 second sleep