aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-02 22:27:50 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-03-02 22:27:50 +0000
commite392677569438f029879307eb6e4057f892a3b72 (patch)
tree55245cd5684df2d883a8bc21fea59b23fdf1a260 /asterisk.c
parenta9624e5b93ee968c7741c65006c0866a65ab4208 (diff)
Merged revisions 11609 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r11609 | tilghman | 2006-03-02 16:26:30 -0600 (Thu, 02 Mar 2006) | 2 lines Bug 6637 - Fixes for Solaris ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@11610 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rw-r--r--asterisk.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/asterisk.c b/asterisk.c
index c980352e6..0b4b12a3d 100644
--- a/asterisk.c
+++ b/asterisk.c
@@ -82,6 +82,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"
@@ -2160,7 +2163,7 @@ int main(int argc, char *argv[])
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)) {
@@ -2180,7 +2183,7 @@ int main(int argc, char *argv[])
}
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)) {
@@ -2189,7 +2192,7 @@ int main(int argc, char *argv[])
}
}
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);
@@ -2254,7 +2257,7 @@ int main(int argc, char *argv[])
unlink(ast_config_AST_PID);
f = fopen(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", ast_config_AST_PID, strerror(errno));
@@ -2265,7 +2268,7 @@ int main(int argc, char *argv[])
unlink(ast_config_AST_PID);
f = fopen(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", ast_config_AST_PID, strerror(errno));