X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest%2Ftest_eal_flags.c;h=9112c96d0e84e6a84c2d7346ed05c8550ea64507;hb=8741a907453681b3c7f3ad8e2fb6de08b9fdf574;hp=e2864107cf008aaf4c52dc56f50e85d5663616e6;hpb=742bde12f3bd008c2f06d744330436d8b1a56720;p=dpdk.git diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c index e2864107cf..9112c96d0e 100644 --- a/app/test/test_eal_flags.c +++ b/app/test/test_eal_flags.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -57,7 +58,7 @@ get_hugepage_path(char * src, int src_len, char * dst, int dst_len) return 0; if (strncmp(tokens[2], "hugetlbfs", sizeof("hugetlbfs")) == 0) { - snprintf(dst, dst_len, "%s", tokens[1]); + strlcpy(dst, tokens[1], dst_len); return 1; } return 0; @@ -231,7 +232,7 @@ static int test_whitelist_flag(void) { unsigned i; -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target doesn't support prefixes at this point */ const char * prefix = ""; #else @@ -297,7 +298,7 @@ test_whitelist_flag(void) static int test_invalid_b_flag(void) { -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target doesn't support prefixes at this point */ const char * prefix = ""; #else @@ -344,7 +345,7 @@ test_invalid_b_flag(void) static int test_invalid_vdev_flag(void) { -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target doesn't support prefixes at this point, and we also need to * run another primary process here */ const char * prefix = no_shconf; @@ -398,7 +399,7 @@ test_invalid_vdev_flag(void) static int test_invalid_r_flag(void) { -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target doesn't support prefixes at this point */ const char * prefix = ""; #else @@ -442,7 +443,7 @@ test_invalid_r_flag(void) static int test_missing_c_flag(void) { -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target doesn't support prefixes at this point */ const char * prefix = ""; #else @@ -592,7 +593,7 @@ test_missing_c_flag(void) static int test_master_lcore_flag(void) { -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target doesn't support prefixes at this point */ const char *prefix = ""; #else @@ -640,7 +641,7 @@ test_master_lcore_flag(void) static int test_invalid_n_flag(void) { -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target doesn't support prefixes at this point */ const char * prefix = ""; #else @@ -690,7 +691,7 @@ test_no_hpet_flag(void) { char prefix[PATH_MAX] = ""; -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD return 0; #else char tmp[PATH_MAX]; @@ -724,7 +725,7 @@ test_no_hpet_flag(void) static int test_no_huge_flag(void) { -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target doesn't support prefixes at this point, and we also need to * run another primary process here */ const char * prefix = no_shconf; @@ -752,7 +753,7 @@ test_no_huge_flag(void) printf("Error - process did not run ok with --no-huge and -m flags\n"); return -1; } -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target does not support NUMA, hence no --socket-mem tests */ return 0; #endif @@ -774,7 +775,7 @@ static int test_misc_flags(void) { char hugepath[PATH_MAX] = {0}; -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target doesn't support prefixes at this point */ const char * prefix = ""; const char * nosh_prefix = ""; @@ -898,7 +899,7 @@ test_misc_flags(void) return -1; } -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* no more tests to be done on FreeBSD */ return 0; #endif @@ -978,7 +979,7 @@ test_file_prefix(void) */ char prefix[PATH_MAX] = ""; -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD return 0; #else if (get_current_prefix(prefix, sizeof(prefix)) == NULL) { @@ -1138,7 +1139,7 @@ test_file_prefix(void) static int test_memory_flags(void) { -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* BSD target doesn't support prefixes at this point */ const char * prefix = ""; #else @@ -1191,7 +1192,7 @@ test_memory_flags(void) char invalid_socket_mem[SOCKET_MEM_STRLEN]; char buf[SOCKET_MEM_STRLEN]; /* to avoid copying string onto itself */ -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD int i, num_sockets = 1; #else int i, num_sockets = RTE_MIN(get_number_of_sockets(), @@ -1247,7 +1248,7 @@ test_memory_flags(void) return -1; } -#ifdef RTE_EXEC_ENV_BSDAPP +#ifdef RTE_EXEC_ENV_FREEBSD /* no other tests are applicable to BSD */ return 0; #endif