mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-09 22:45:49 +00:00
Fix compiler warnings on Fedora 26 / GCC 7.
GCC 7 has added capability to produce warnings, this fixes most of those warnings. The specific warnings are disabled in a few places: * app_voicemail.c: truncation of paths more than 4096 chars in many places. * chan_mgcp.c: callid truncated to 80 chars. * cdr.c: two userfields are combined to cdr copy, fix would break ABI. * tcptls.c: ignore use of deprecated method SSLv3_client_method(). ASTERISK-27156 #close Change-Id: I65f280e7d3cfad279d16f41823a4d6fddcbc4c88
This commit is contained in:
committed by
George Joseph
parent
0d58fefa30
commit
0f49e6ee2e
@@ -46,6 +46,8 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
||||
#include "include/firmware.h"
|
||||
|
||||
#define IAX_FIRMWARE_SUBDIR "/firmware/iax"
|
||||
|
||||
struct iax_firmware {
|
||||
AST_LIST_ENTRY(iax_firmware) list;
|
||||
int fd;
|
||||
@@ -208,7 +210,7 @@ void iax_firmware_reload(void)
|
||||
struct iax_firmware *cur = NULL;
|
||||
DIR *fwd;
|
||||
struct dirent *de;
|
||||
char dir[256], fn[256];
|
||||
char fn[PATH_MAX + sizeof(IAX_FIRMWARE_SUBDIR) + sizeof(de->d_name)];
|
||||
|
||||
AST_LIST_LOCK(&firmwares);
|
||||
|
||||
@@ -218,12 +220,13 @@ void iax_firmware_reload(void)
|
||||
}
|
||||
|
||||
/* Now that we have marked them dead... load new ones */
|
||||
snprintf(dir, sizeof(dir), "%s/firmware/iax", ast_config_AST_DATA_DIR);
|
||||
fwd = opendir(dir);
|
||||
snprintf(fn, sizeof(fn), "%s%s", ast_config_AST_DATA_DIR, IAX_FIRMWARE_SUBDIR);
|
||||
fwd = opendir(fn);
|
||||
if (fwd) {
|
||||
while((de = readdir(fwd))) {
|
||||
if (de->d_name[0] != '.') {
|
||||
snprintf(fn, sizeof(fn), "%s/%s", dir, de->d_name);
|
||||
snprintf(fn, sizeof(fn), "%s%s/%s",
|
||||
ast_config_AST_DATA_DIR, IAX_FIRMWARE_SUBDIR, de->d_name);
|
||||
if (!try_firmware(fn)) {
|
||||
ast_verb(2, "Loaded firmware '%s'\n", de->d_name);
|
||||
}
|
||||
@@ -231,7 +234,7 @@ void iax_firmware_reload(void)
|
||||
}
|
||||
closedir(fwd);
|
||||
} else {
|
||||
ast_log(LOG_WARNING, "Error opening firmware directory '%s': %s\n", dir, strerror(errno));
|
||||
ast_log(LOG_WARNING, "Error opening firmware directory '%s': %s\n", fn, strerror(errno));
|
||||
}
|
||||
|
||||
/* Clean up leftovers */
|
||||
|
Reference in New Issue
Block a user