Permalink
Browse files

Remove compilation errors from gcc on Solaris

  • Loading branch information...
1 parent d747f59 commit 3fa313718559d7bb044511e4c8c5094d44bf0818 Trond Norbye committed with dustin Aug 20, 2009
Showing with 5 additions and 4 deletions.
  1. +1 −1 memcached.h
  2. +2 −1 solaris_priv.c
  3. +2 −2 testapp.c
View
@@ -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
View
@@ -1,14 +1,15 @@
#include <stdlib.h>
#include <priv.h>
#include <stdio.h>
+#include "memcached.h"
/*
* this section of code will drop all (Solaris) privileges including
* those normally granted to all userland process (basic privileges). The
* 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) {
View
@@ -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);

0 comments on commit 3fa3137

Please sign in to comment.