aboutsummaryrefslogtreecommitdiffstats
path: root/asterisk.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-03 02:41:59 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2005-06-03 02:41:59 +0000
commit490f32fc4b2413e6139d495013011e42d0a4c43f (patch)
tree5dcf950c757c1db45089557ac37faad6303b91fe /asterisk.c
parent61e53e40334989017613a7bb938152fd2ecc43f6 (diff)
don't call poll() with an unitialized structure (bug #4387)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5826 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'asterisk.c')
-rwxr-xr-xasterisk.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/asterisk.c b/asterisk.c
index 6edb01e48..4bb6c1742 100755
--- a/asterisk.c
+++ b/asterisk.c
@@ -467,7 +467,7 @@ static int ast_makesocket(void)
if (perms!=NULL) {
mode_t p;
- sscanf(perms,"%o",&p);
+ sscanf(perms, "%o", (int *) &p);
if ((chmod(ast_config_AST_SOCKET,p))<0)
ast_log(LOG_WARNING, "Unable to change file permissions of %s: %s\n", ast_config_AST_SOCKET,strerror(errno));
}
@@ -1690,7 +1690,6 @@ int main(int argc, char *argv[])
int num;
char *buf;
char *runuser=NULL, *rungroup=NULL;
- struct pollfd silly_macos[1];
/* Remember original args for restart */
if (argc > sizeof(_argv) / sizeof(_argv[0]) - 1) {
@@ -2060,7 +2059,9 @@ int main(int argc, char *argv[])
}
/* Do nothing */
- for(;;)
- poll(silly_macos,0, -1);
+ for(;;) { /* apparently needed for the MACos */
+ struct pollfd p = { -1 /* no descriptor */, 0, 0 };
+ poll(&p, 0, -1);
+ }
return 0;
}