[asterisk-commits] branch 1.2 r11609 - /branches/1.2/asterisk.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Mar 2 15:26:31 MST 2006
Author: tilghman
Date: Thu Mar 2 16:26:30 2006
New Revision: 11609
URL: http://svn.digium.com/view/asterisk?rev=11609&view=rev
Log:
Bug 6637 - Fixes for Solaris
Modified:
branches/1.2/asterisk.c
Modified: branches/1.2/asterisk.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/asterisk.c?rev=11609&r1=11608&r2=11609&view=diff
==============================================================================
--- branches/1.2/asterisk.c (original)
+++ branches/1.2/asterisk.c Thu Mar 2 16:26:30 2006
@@ -83,6 +83,9 @@
#if defined(__FreeBSD__) || defined( __NetBSD__ ) || defined(SOLARIS)
#include <netdb.h>
+#if defined(SOLARIS)
+extern int daemon(int, int); /* defined in libresolv of all places */
+#endif
#endif
#include "asterisk.h"
@@ -2175,7 +2178,7 @@
exit(1);
}
if (setgid(gr->gr_gid)) {
- ast_log(LOG_WARNING, "Unable to setgid to %d (%s)\n", gr->gr_gid, rungroup);
+ ast_log(LOG_WARNING, "Unable to setgid to %d (%s)\n", (int)gr->gr_gid, rungroup);
exit(1);
}
if (setgroups(0, NULL)) {
@@ -2195,7 +2198,7 @@
}
if (!rungroup) {
if (setgid(pw->pw_gid)) {
- ast_log(LOG_WARNING, "Unable to setgid to %d!\n", pw->pw_gid);
+ ast_log(LOG_WARNING, "Unable to setgid to %d!\n", (int)pw->pw_gid);
exit(1);
}
if (initgroups(pw->pw_name, pw->pw_gid)) {
@@ -2204,7 +2207,7 @@
}
}
if (setuid(pw->pw_uid)) {
- ast_log(LOG_WARNING, "Unable to setuid to %d (%s)\n", pw->pw_uid, runuser);
+ ast_log(LOG_WARNING, "Unable to setuid to %d (%s)\n", (int)pw->pw_uid, runuser);
exit(1);
}
setenv("ASTERISK_ALREADY_NONROOT","yes",1);
@@ -2271,7 +2274,7 @@
unlink((char *)ast_config_AST_PID);
f = fopen((char *)ast_config_AST_PID, "w");
if (f) {
- fprintf(f, "%d\n", getpid());
+ fprintf(f, "%d\n", (int)getpid());
fclose(f);
} else
ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", (char *)ast_config_AST_PID, strerror(errno));
@@ -2282,7 +2285,7 @@
unlink((char *)ast_config_AST_PID);
f = fopen((char *)ast_config_AST_PID, "w");
if (f) {
- fprintf(f, "%d\n", getpid());
+ fprintf(f, "%d\n", (int)getpid());
fclose(f);
} else
ast_log(LOG_WARNING, "Unable to open pid file '%s': %s\n", (char *)ast_config_AST_PID, strerror(errno));
More information about the asterisk-commits
mailing list