]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
main, res, tests: Fix compilation errors on FreeBSD.
authorNaveen Albert <asterisk@phreaknet.org>
Sun, 29 Sep 2024 13:26:10 +0000 (09:26 -0400)
committerAsterisk Development Team <asteriskteam@digium.com>
Thu, 14 Nov 2024 20:01:34 +0000 (20:01 +0000)
asterisk.c, manager.c: Increase buffer sizes to avoid truncation warnings.
config.c: Include header file for WIFEXITED/WEXITSTATUS macros.
res_timing_kqueue: Use more portable format specifier.
test_crypto: Use non-linux limits.h header file.

Resolves: #916
(cherry picked from commit b8b21b3f00a8e0a46b547200581bccc1997a9df7)

main/asterisk.c
main/config.c
main/manager.c
res/res_timing_kqueue.c
tests/test_crypto.c

index 08d12a37576dfc76b52f0c2ada59db83bde0d5fe..527ed4445c5686f69f09b3d5e0ebf83a76c1309f 100644 (file)
@@ -4340,7 +4340,7 @@ static void asterisk_daemon(int isroot, const char *runuser, const char *rungrou
        if (ast_opt_console) {
                /* Console stuff now... */
                /* Register our quit function */
-               char title[256];
+               char title[296];
                char hostname[MAXHOSTNAMELEN] = "";
 
                if (gethostname(hostname, sizeof(hostname) - 1)) {
index e7ac4149a6df8d54f95e137e48b49204f53485d1..e3438da6c9bb2aa32435b539dda76dff3c640958 100644 (file)
@@ -44,6 +44,7 @@
 #include <libgen.h>
 #include <time.h>
 #include <sys/stat.h>
+#include <sys/wait.h>
 
 #include <math.h>      /* HUGE_VAL */
 #include <regex.h>
index fdf64d52b25d39b651617c11c7e7b672be3505ad..a59889f22d745aca8e39692410c8845f831f8c95 100644 (file)
@@ -9443,7 +9443,7 @@ static int __init_manager(int reload, int by_external_config)
        struct ast_manager_user *user = NULL;
        struct ast_variable *var;
        struct ast_flags config_flags = { (reload && !by_external_config) ? CONFIG_FLAG_FILEUNCHANGED : 0 };
-       char a1[256];
+       char a1[337];
        char a1_hash[256];
        struct ast_sockaddr ami_desc_local_address_tmp;
        struct ast_sockaddr amis_desc_local_address_tmp;
index f568144aa5e805e88c7af5d3667c7e5a3bc3e39f..d61f3d873488877abf4b422d19934e5c4fce2489 100644 (file)
@@ -466,7 +466,7 @@ AST_TEST_DEFINE(test_kqueue_timing)
 
                }
                diff = ast_tvdiff_us(ast_tvnow(), start);
-               ast_test_status_update(test, "diff is %llu\n", diff);
+               ast_test_status_update(test, "diff is %" PRIu64 "\n", diff);
        } while (0);
        kqueue_timer_close(kt);
        return res;
index 8b52c9df383e30b444e68719bf7c06d459efe46d..8e83800ba880b412b9eeb7b0377687492f4051d6 100644 (file)
@@ -41,7 +41,7 @@
 
 #include <assert.h>
 #include <sys/stat.h>
-#include <linux/limits.h>
+#include <limits.h>
 #include <openssl/evp.h>
 
 static const char *keypair1 = "rsa_key1";