aboutsummaryrefslogtreecommitdiffstats
path: root/util-src
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-10-02 17:14:54 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-10-02 17:14:54 +0500
commit727cc275bba229332912af42fe0e55524d73efdb (patch)
tree1698593f49c403ff2d25ee9c6bc7a78be9de44c2 /util-src
parent498421b3bac3f259cc2a7b65cea6f7601a974d88 (diff)
parent271afa36733db02b9cace7261a16b8243505bf33 (diff)
downloadprosody-727cc275bba229332912af42fe0e55524d73efdb.tar.gz
prosody-727cc275bba229332912af42fe0e55524d73efdb.zip
Merge
Diffstat (limited to 'util-src')
-rw-r--r--util-src/Makefile15
-rw-r--r--util-src/lsignal.c2
-rw-r--r--util-src/pposix.c14
3 files changed, 24 insertions, 7 deletions
diff --git a/util-src/Makefile b/util-src/Makefile
index 3b7ca7bc..fdf97c53 100644
--- a/util-src/Makefile
+++ b/util-src/Makefile
@@ -24,21 +24,28 @@ clean:
encodings.o: encodings.c
$(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o encodings.o encodings.c
encodings.so: encodings.o
- export MACOSX_DEPLOYMENT_TARGET="10.3"; $(LD) $(LFLAGS) -o encodings.so encodings.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) -lidn
+ MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET;
+ $(LD) $(LFLAGS) -o encodings.so encodings.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) -lidn
hashes.o: hashes.c
$(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o hashes.o hashes.c
hashes.so: hashes.o
- export MACOSX_DEPLOYMENT_TARGET="10.3"; $(LD) $(LFLAGS) -o hashes.so hashes.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) -lcrypto
+ MACOSX_DEPLOYMENT_TARGET="10.3";
+ export MACOSX_DEPLOYMENT_TARGET;
+ $(LD) $(LFLAGS) -o hashes.so hashes.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX) -lcrypto
pposix.o: pposix.c
$(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o pposix.o pposix.c
pposix.so: pposix.o
- export MACOSX_DEPLOYMENT_TARGET="10.3"; $(LD) $(LFLAGS) -o pposix.so pposix.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX)
+ MACOSX_DEPLOYMENT_TARGET="10.3";
+ export MACOSX_DEPLOYMENT_TARGET;
+ $(LD) $(LFLAGS) -o pposix.so pposix.o -L$(LUA_LIBDIR) -llua$(LUA_SUFFIX)
lsignal.o: lsignal.c
$(CC) $(CFLAGS) -I$(LUA_INCDIR) -c -o lsignal.o lsignal.c
signal.so: lsignal.o
- export MACOSX_DEPLOYMENT_TARGET="10.3"; $(LD) $(LFLAGS) -o signal.so lsignal.o
+ MACOSX_DEPLOYMENT_TARGET="10.3";
+ export MACOSX_DEPLOYMENT_TARGET;
+ $(LD) $(LFLAGS) -o signal.so lsignal.o
diff --git a/util-src/lsignal.c b/util-src/lsignal.c
index 158efcd6..80799e4a 100644
--- a/util-src/lsignal.c
+++ b/util-src/lsignal.c
@@ -301,7 +301,7 @@ static int l_raise(lua_State *L)
return 1;
}
-#ifdef _POSIX_SOURCE
+#if defined _POSIX_SOURCE || (defined(sun) || defined(__sun))
/* define some posix only functions */
diff --git a/util-src/pposix.c b/util-src/pposix.c
index d27a84b1..265245e0 100644
--- a/util-src/pposix.c
+++ b/util-src/pposix.c
@@ -91,10 +91,14 @@ static int lc_daemonize(lua_State *L)
const char * const facility_strings[] = {
"auth",
+#if !(defined(sun) || defined(__sun))
"authpriv",
+#endif
"cron",
"daemon",
+#if !(defined(sun) || defined(__sun))
"ftp",
+#endif
"kern",
"local0",
"local1",
@@ -113,10 +117,14 @@ const char * const facility_strings[] = {
};
int facility_constants[] = {
LOG_AUTH,
+#if !(defined(sun) || defined(__sun))
LOG_AUTHPRIV,
+#endif
LOG_CRON,
LOG_DAEMON,
+#if !(defined(sun) || defined(__sun))
LOG_FTP,
+#endif
LOG_KERN,
LOG_LOCAL0,
LOG_LOCAL1,
@@ -365,11 +373,13 @@ int string2resource(const char *s) {
if (!strcmp(s, "CPU")) return RLIMIT_CPU;
if (!strcmp(s, "DATA")) return RLIMIT_DATA;
if (!strcmp(s, "FSIZE")) return RLIMIT_FSIZE;
- if (!strcmp(s, "MEMLOCK")) return RLIMIT_MEMLOCK;
if (!strcmp(s, "NOFILE")) return RLIMIT_NOFILE;
+ if (!strcmp(s, "STACK")) return RLIMIT_STACK;
+#if !(defined(sun) || defined(__sun))
+ if (!strcmp(s, "MEMLOCK")) return RLIMIT_MEMLOCK;
if (!strcmp(s, "NPROC")) return RLIMIT_NPROC;
if (!strcmp(s, "RSS")) return RLIMIT_RSS;
- if (!strcmp(s, "STACK")) return RLIMIT_STACK;
+#endif
return -1;
}