summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/ast_expr2.c1
-rw-r--r--main/ast_expr2.y1
-rw-r--r--main/astfd.c2
-rw-r--r--main/codec.c10
-rw-r--r--main/codec_builtin.c6
-rw-r--r--main/editline/Makefile.in2
6 files changed, 14 insertions, 8 deletions
diff --git a/main/ast_expr2.c b/main/ast_expr2.c
index 798e3d3ce..a9e4eff44 100644
--- a/main/ast_expr2.c
+++ b/main/ast_expr2.c
@@ -93,6 +93,7 @@
#include "asterisk.h"
+#include <sys/cdefs.h>
#include <sys/types.h>
#include <stdio.h>
diff --git a/main/ast_expr2.y b/main/ast_expr2.y
index 83d3effe3..869dfe9ea 100644
--- a/main/ast_expr2.y
+++ b/main/ast_expr2.y
@@ -14,6 +14,7 @@
#include "asterisk.h"
+#include <sys/cdefs.h>
#include <sys/types.h>
#include <stdio.h>
diff --git a/main/astfd.c b/main/astfd.c
index d2cb73a6b..a96471d60 100644
--- a/main/astfd.c
+++ b/main/astfd.c
@@ -271,7 +271,7 @@ static char *handle_show_fd(struct ast_cli_entry *e, int cmd, struct ast_cli_arg
case CLI_GENERATE:
return NULL;
}
- getrlimit(RLIMIT_FSIZE, &rl);
+ getrlimit(RLIMIT_NOFILE, &rl);
if (rl.rlim_cur == RLIM_INFINITY || rl.rlim_max == RLIM_INFINITY) {
ast_copy_string(line, "unlimited", sizeof(line));
} else {
diff --git a/main/codec.c b/main/codec.c
index 543d4d0bd..c8644fd34 100644
--- a/main/codec.c
+++ b/main/codec.c
@@ -135,8 +135,8 @@ static char *show_codecs(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
"\tIt does not indicate anything about your configuration.\n");
}
- ast_cli(a->fd, "%8s %5s %8s %s\n","ID","TYPE","NAME","DESCRIPTION");
- ast_cli(a->fd, "-----------------------------------------------------------------------------------\n");
+ ast_cli(a->fd, "%8s %-5s %-12s %-16s %s\n","ID","TYPE","NAME","FORMAT","DESCRIPTION");
+ ast_cli(a->fd, "------------------------------------------------------------------------------------------------\n");
ao2_rdlock(codecs);
i = ao2_iterator_init(codecs, AO2_ITERATOR_DONTLOCK);
@@ -164,10 +164,11 @@ static char *show_codecs(struct ast_cli_entry *e, int cmd, struct ast_cli_args *
}
}
- ast_cli(a->fd, "%8u %5s %8s (%s)\n",
+ ast_cli(a->fd, "%8u %-5s %-12s %-16s (%s)\n",
codec->id,
ast_codec_media_type2str(codec->type),
codec->name,
+ S_OR(codec->format_name, "no cached format"),
codec->description);
}
@@ -216,7 +217,8 @@ static char *show_codec(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a
return CLI_SUCCESS;
}
- ast_cli(a->fd, "%11u %s\n", (unsigned int) codec->id, codec->description);
+ ast_cli(a->fd, "%11u %s (%s)\n", (unsigned int) codec->id, codec->description,
+ S_OR(codec->format_name, "no format"));
ao2_ref(codec, -1);
diff --git a/main/codec_builtin.c b/main/codec_builtin.c
index 346b47b87..d7d253ab8 100644
--- a/main/codec_builtin.c
+++ b/main/codec_builtin.c
@@ -774,6 +774,7 @@ static struct ast_codec t140 = {
int __res_ ## __LINE__ = 0; \
struct ast_format *__fmt_ ## __LINE__; \
struct ast_codec *__codec_ ## __LINE__; \
+ codec.format_name = (codec).name; \
res |= __ast_codec_register(&(codec), NULL); \
__codec_ ## __LINE__ = ast_codec_get((codec).name, (codec).type, (codec).sample_rate); \
__fmt_ ## __LINE__ = __codec_ ## __LINE__ ? ast_format_create(__codec_ ## __LINE__) : NULL; \
@@ -783,14 +784,15 @@ static struct ast_codec t140 = {
__res_ ## __LINE__; \
})
-#define CODEC_REGISTER_AND_CACHE_NAMED(format_name, codec) \
+#define CODEC_REGISTER_AND_CACHE_NAMED(fmt_name, codec) \
({ \
int __res_ ## __LINE__ = 0; \
struct ast_format *__fmt_ ## __LINE__; \
struct ast_codec *__codec_ ## __LINE__; \
+ codec.format_name = fmt_name; \
res |= __ast_codec_register(&(codec), NULL); \
__codec_ ## __LINE__ = ast_codec_get((codec).name, (codec).type, (codec).sample_rate); \
- __fmt_ ## __LINE__ = ast_format_create_named((format_name), __codec_ ## __LINE__); \
+ __fmt_ ## __LINE__ = ast_format_create_named((fmt_name), __codec_ ## __LINE__); \
res |= ast_format_cache_set(__fmt_ ## __LINE__); \
ao2_ref(__fmt_ ## __LINE__, -1); \
ao2_ref(__codec_ ## __LINE__, -1); \
diff --git a/main/editline/Makefile.in b/main/editline/Makefile.in
index 112b68b64..2be4333d5 100644
--- a/main/editline/Makefile.in
+++ b/main/editline/Makefile.in
@@ -187,7 +187,7 @@ distclean : clean
#
$(LIB_A) : $(BGCSRCS:.c=.o_a) $(CCSRCS:.c=.o_a)
- $(AR) cru $@ $?
+ $(AR) cr $@ $?
$(RANLIB) $@
$(LIB_S) : $(BGCSRCS:.c=.o_s) $(CCSRCS:.c=.o_s)