From 3fa313718559d7bb044511e4c8c5094d44bf0818 Mon Sep 17 00:00:00 2001 From: Trond Norbye Date: Thu, 20 Aug 2009 19:56:51 +0200 Subject: [PATCH] Remove compilation errors from gcc on Solaris --- memcached.h | 2 +- solaris_priv.c | 3 ++- testapp.c | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/memcached.h b/memcached.h index b461c1aa13..be2359a6ef 100644 --- a/memcached.h +++ b/memcached.h @@ -470,7 +470,7 @@ void append_stat(const char *name, ADD_STAT add_stats, conn *c, enum store_item_type store_item(item *item, int comm, conn *c); #if HAVE_DROP_PRIVILEGES -extern void drop_privileges(); +extern void drop_privileges(void); #else #define drop_privileges() #endif diff --git a/solaris_priv.c b/solaris_priv.c index c730eb242d..349334e438 100644 --- a/solaris_priv.c +++ b/solaris_priv.c @@ -1,6 +1,7 @@ #include #include #include +#include "memcached.h" /* * this section of code will drop all (Solaris) privileges including @@ -8,7 +9,7 @@ * effect of this is that after running this code, the process will not able * to fork(), exec(), etc. See privileges(5) for more information. */ -void drop_privileges() { +void drop_privileges(void) { priv_set_t *privs = priv_str_to_set("basic", ",", NULL); if (privs == NULL) { diff --git a/testapp.c b/testapp.c index 9afcf396d5..d93f1e2ec1 100644 --- a/testapp.c +++ b/testapp.c @@ -252,10 +252,10 @@ static enum test_return test_safe_strtol(void) { static pid_t start_server(in_port_t *port_out, bool daemon) { char environment[80]; snprintf(environment, sizeof(environment), - "MEMCACHED_PORT_FILENAME=/tmp/ports.%u", getpid()); + "MEMCACHED_PORT_FILENAME=/tmp/ports.%lu", (long)getpid()); char *filename= environment + strlen("MEMCACHED_PORT_FILENAME="); char pid_file[80]; - snprintf(pid_file, sizeof(pid_file), "/tmp/pid.%u", getpid()); + snprintf(pid_file, sizeof(pid_file), "/tmp/pid.%lu", (long)getpid()); remove(filename); remove(pid_file);