Skip to content

Commit

Permalink
Remove compilation errors from gcc on Solaris
Browse files Browse the repository at this point in the history
  • Loading branch information
Trond Norbye authored and dustin committed Aug 23, 2009
1 parent d747f59 commit 3fa3137
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion memcached.h
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion solaris_priv.c
@@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions testapp.c
Expand Up @@ -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);
Expand Down

0 comments on commit 3fa3137

Please sign in to comment.