aboutsummaryrefslogtreecommitdiffstats
path: root/main/logger.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-04 01:34:59 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-11-04 01:34:59 +0000
commit3ecef4ec7a6337ad850081a69b9536c4d61acaf1 (patch)
tree5477f130ab36ed5e0956e10ab0824d9263b34a51 /main/logger.c
parent81c03c76845c0bb79405bed8aeb2278a57524e8d (diff)
remove many unnecessary casts
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47186 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/logger.c')
-rw-r--r--main/logger.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/main/logger.c b/main/logger.c
index e0d2aab59..95a768dbd 100644
--- a/main/logger.c
+++ b/main/logger.c
@@ -269,9 +269,9 @@ static struct logchannel *make_logchannel(char *channel, char *components, int l
}
if(!ast_strlen_zero(hostname)) {
- snprintf(chan->filename, sizeof(chan->filename), "%s/%s.%s",(char *)ast_config_AST_LOG_DIR, channel, hostname);
+ snprintf(chan->filename, sizeof(chan->filename), "%s/%s.%s", ast_config_AST_LOG_DIR, channel, hostname);
} else {
- snprintf(chan->filename, sizeof(chan->filename), "%s/%s", (char *)ast_config_AST_LOG_DIR, channel);
+ snprintf(chan->filename, sizeof(chan->filename), "%s/%s", ast_config_AST_LOG_DIR, channel);
}
chan->fileptr = fopen(chan->filename, "a");
if (!chan->fileptr) {
@@ -395,7 +395,7 @@ int reload_logger(int rotate)
queue_rotate = 0;
qlog = NULL;
- mkdir((char *)ast_config_AST_LOG_DIR, 0755);
+ mkdir(ast_config_AST_LOG_DIR, 0755);
AST_LIST_TRAVERSE(&logchannels, f, list) {
if (f->disabled) {
@@ -411,7 +411,7 @@ int reload_logger(int rotate)
if (!rotatetimestamp) {
for (x = 0; ; x++) {
snprintf(new, sizeof(new), "%s.%d", f->filename, x);
- myf = fopen((char *)new, "r");
+ myf = fopen(new, "r");
if (myf)
fclose(myf);
else
@@ -432,19 +432,19 @@ int reload_logger(int rotate)
init_logger_chain();
if (logfiles.event_log) {
- snprintf(old, sizeof(old), "%s/%s", (char *)ast_config_AST_LOG_DIR, EVENTLOG);
+ snprintf(old, sizeof(old), "%s/%s", ast_config_AST_LOG_DIR, EVENTLOG);
if (event_rotate) {
if (!rotatetimestamp) {
for (x=0;;x++) {
- snprintf(new, sizeof(new), "%s/%s.%d", (char *)ast_config_AST_LOG_DIR, EVENTLOG,x);
- myf = fopen((char *)new, "r");
+ snprintf(new, sizeof(new), "%s/%s.%d", ast_config_AST_LOG_DIR, EVENTLOG,x);
+ myf = fopen(new, "r");
if (myf) /* File exists */
fclose(myf);
else
break;
}
} else
- snprintf(new, sizeof(new), "%s/%s.%ld", (char *)ast_config_AST_LOG_DIR, EVENTLOG,(long)time(NULL));
+ snprintf(new, sizeof(new), "%s/%s.%ld", ast_config_AST_LOG_DIR, EVENTLOG,(long)time(NULL));
/* do it */
if (rename(old,new))
@@ -463,12 +463,12 @@ int reload_logger(int rotate)
}
if (logfiles.queue_log) {
- snprintf(old, sizeof(old), "%s/%s", (char *)ast_config_AST_LOG_DIR, queue_log_name);
+ snprintf(old, sizeof(old), "%s/%s", ast_config_AST_LOG_DIR, queue_log_name);
if (queue_rotate) {
if (!rotatetimestamp) {
for (x = 0; ; x++) {
- snprintf(new, sizeof(new), "%s/%s.%d", (char *)ast_config_AST_LOG_DIR, queue_log_name, x);
- myf = fopen((char *)new, "r");
+ snprintf(new, sizeof(new), "%s/%s.%d", ast_config_AST_LOG_DIR, queue_log_name, x);
+ myf = fopen(new, "r");
if (myf) /* File exists */
fclose(myf);
else
@@ -476,7 +476,7 @@ int reload_logger(int rotate)
}
} else
- snprintf(new, sizeof(new), "%s/%s.%ld", (char *)ast_config_AST_LOG_DIR, queue_log_name,(long)time(NULL));
+ snprintf(new, sizeof(new), "%s/%s.%ld", ast_config_AST_LOG_DIR, queue_log_name,(long)time(NULL));
/* do it */
if (rename(old, new))
ast_log(LOG_ERROR, "Unable to rename file '%s' to '%s'\n", old, new);
@@ -605,20 +605,20 @@ int init_logger(void)
/* register the logger cli commands */
ast_cli_register_multiple(cli_logger, sizeof(cli_logger) / sizeof(struct ast_cli_entry));
- mkdir((char *)ast_config_AST_LOG_DIR, 0755);
+ mkdir(ast_config_AST_LOG_DIR, 0755);
/* create log channels */
init_logger_chain();
/* create the eventlog */
if (logfiles.event_log) {
- mkdir((char *)ast_config_AST_LOG_DIR, 0755);
- snprintf(tmp, sizeof(tmp), "%s/%s", (char *)ast_config_AST_LOG_DIR, EVENTLOG);
- eventlog = fopen((char *)tmp, "a");
+ mkdir(ast_config_AST_LOG_DIR, 0755);
+ snprintf(tmp, sizeof(tmp), "%s/%s", ast_config_AST_LOG_DIR, EVENTLOG);
+ eventlog = fopen(tmp, "a");
if (eventlog) {
ast_log(LOG_EVENT, "Started Asterisk Event Logger\n");
if (option_verbose)
- ast_verbose("Asterisk Event Logger Started %s\n",(char *)tmp);
+ ast_verbose("Asterisk Event Logger Started %s\n", tmp);
} else {
ast_log(LOG_ERROR, "Unable to create event log: %s\n", strerror(errno));
res = -1;
@@ -626,7 +626,7 @@ int init_logger(void)
}
if (logfiles.queue_log) {
- snprintf(tmp, sizeof(tmp), "%s/%s", (char *)ast_config_AST_LOG_DIR, queue_log_name);
+ snprintf(tmp, sizeof(tmp), "%s/%s", ast_config_AST_LOG_DIR, queue_log_name);
qlog = fopen(tmp, "a");
ast_queue_log("NONE", "NONE", "NONE", "QUEUESTART", "%s", "");
}