util.pposix: Compatibility with Solaris systems (thanks Filip)

Tue, 29 Sep 2009 14:22:02 +0100

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 29 Sep 2009 14:22:02 +0100
changeset 1842
8337c0d4aee4
parent 1841
0dc1daa94e7f
child 1843
07d8c9184a5f
child 1844
a4a8fe2a560c

util.pposix: Compatibility with Solaris systems (thanks Filip)

util-src/pposix.c file | annotate | diff | comparison | revisions
--- a/util-src/pposix.c	Tue Sep 29 14:06:43 2009 +0100
+++ b/util-src/pposix.c	Tue Sep 29 14:22:02 2009 +0100
@@ -91,10 +91,14 @@
 
 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 @@
 				};
 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 @@
 	if (!strcmp(s, "CPU")) return RLIMIT_CPU;
 	if (!strcmp(s, "DATA")) return RLIMIT_DATA;
 	if (!strcmp(s, "FSIZE")) return RLIMIT_FSIZE;
+	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, "NOFILE")) return RLIMIT_NOFILE;
 	if (!strcmp(s, "NPROC")) return RLIMIT_NPROC;
 	if (!strcmp(s, "RSS")) return RLIMIT_RSS;
-	if (!strcmp(s, "STACK")) return RLIMIT_STACK;
+#endif
 	return -1;
 }
 

mercurial