Skip to content

Commit d1d41e8

Browse files
authored
Merge pull request #261 from nasa/217-mc-how-to-handle-where-file-is-written
217 mc how to handle where file is written
2 parents f5e2d72 + dd7b27f commit d1d41e8

File tree

8 files changed

+22
-2
lines changed

8 files changed

+22
-2
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ project(crypto C)
2424
set(SA_CUSTOM_PATH_DEFAULT "../../sa/custom")
2525
set(KEY_CUSTOM_PATH_DEFAULT "../../key/custom")
2626
set(MC_CUSTOM_PATH_DEFAULT "../../mc/custom")
27+
set(MC_LOG_PATH_DEFAULT "log.txt")
2728
set(CRYPTO_CUSTOM_PATH_DEFAULT "../../crypto/custom")
2829

2930

@@ -120,6 +121,13 @@ if(DEBUG)
120121
add_compile_options(-ggdb)
121122
endif()
122123

124+
if(DEFINED MC_LOG_CUSTOM_PATH)
125+
message(STATUS "MC_LOG_CUSTOM_PATH set to: ${MC_LOG_CUSTOM_PATH}")
126+
add_compile_definitions(MC_LOG_PATH="${MC_LOG_CUSTOM_PATH}")
127+
else()
128+
add_compile_definitions(MC_LOG_PATH="${MC_LOG_PATH_DEFAULT}")
129+
endif()
130+
123131
IF(KMC_MDB_RH)
124132
ADD_DEFINITIONS(-DKMC_MDB_RH)
125133
ADD_DEFINITIONS(-DKMC_CFFI_EXCLUDE)

src/mc/internal/mc_interface_internal.template.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ static int32_t mc_initialize(void)
5353
int32_t status = CRYPTO_LIB_SUCCESS;
5454

5555
/* Open log */
56-
mc_file_ptr = fopen("log.txt", "a");
56+
mc_file_ptr = fopen(MC_LOG_PATH, "a");
5757
if (mc_file_ptr == NULL)
5858
{
5959
status = CRYPTO_LIB_ERR_MC_INIT;
60-
printf(KRED "ERROR: Monitoring andcontrol initialization - internal failed\n" RESET);
60+
printf(KRED "ERROR: Monitoring and control initialization - internal failed\n" RESET);
6161
}
6262

6363
return status;

support/scripts/build_internal.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1010
source $SCRIPT_DIR/env.sh
1111

12+
rm $BASE_DIR/CMakeCache.txt
13+
1214
cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DMC_INTERNAL=1 -DTEST=1 -DTEST_ENC=1 -DSA_FILE=1 -DKEY_VALIDATION=0 && make && make test

support/scripts/build_kmc.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1010
source $SCRIPT_DIR/env.sh
1111

12+
rm $BASE_DIR/CMakeCache.txt
13+
1214
cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DCRYPTO_KMC=1 -DKEY_KMC=1 -DMC_DISABLED=1 -DSA_MARIADB=1 -DTEST=1 -DTEST_ENC=1 -DKMC_CFFI_EXCLUDE=1 -DSA_FILE=1 && make && make test

support/scripts/build_minimal.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1010
source $SCRIPT_DIR/env.sh
1111

12+
rm $BASE_DIR/CMakeCache.txt
13+
1214
cmake $BASE_DIR && make && make test

support/scripts/build_rhel.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1010
source $SCRIPT_DIR/env.sh
1111

12+
rm $BASE_DIR/CMakeCache.txt
13+
1214
cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DMC_INTERNAL=1 -DTEST=1 -DTEST_ENC=1 -DSA_FILE=1 && make && make test

support/scripts/build_support.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1010
source $SCRIPT_DIR/env.sh
1111

12+
rm $BASE_DIR/CMakeCache.txt
13+
1214
cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DSUPPORT=1 -DTEST=1 -DTEST_ENC=1 && make && make test

support/scripts/build_wolf.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@
99
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
1010
source $SCRIPT_DIR/env.sh
1111

12+
rm $BASE_DIR/CMakeCache.txt
13+
1214
cmake $BASE_DIR -DCODECOV=1 -DDEBUG=1 -DCRYPTO_LIBGCRYPT=0 -DCRYPTO_WOLFSSL=1 -DTEST=1 -DTEST_ENC=1 -DSA_FILE=1 && make && make test

0 commit comments

Comments
 (0)