Adapt psasim

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2024-07-18 15:21:20 +02:00
parent c29dd98908
commit b6f6cc89d0
5 changed files with 8 additions and 8 deletions

View File

@ -77,5 +77,5 @@ clean_server_intermediate_files:
clean: clean_server_intermediate_files
rm -f test/psa_client_base test/psa_client_full test/psa_server
rm -rf client_libs server_libs
rm -f test/psa_service_* test/psa_notify_* test/*.log
rm -f test/*.log
rm -f test/seedfile

View File

@ -28,4 +28,4 @@
#define PROJECT_ID 'M'
#define PATHNAMESIZE 256
#define TMP_FILE_BASE_PATH "./"
#define TMP_FILE_BASE_PATH "/tmp/"

View File

@ -605,9 +605,9 @@ void __init_psasim(const char **array,
key_t key;
int qid;
FILE *fp;
char doorbell_path[PATHNAMESIZE] = { 0 };
char doorbell_file[PATHNAMESIZE] = { 0 };
char queue_path[PATHNAMESIZE];
snprintf(doorbell_path, PATHNAMESIZE, TMP_FILE_BASE_PATH "psa_notify_%u", getpid());
snprintf(doorbell_file, PATHNAMESIZE, "psa_notify_%u", getpid());
if (library_initialised > 0) {
return;
@ -619,7 +619,7 @@ void __init_psasim(const char **array,
FATAL("Unsupported value. Aborting.");
}
array[3] = doorbell_path;
array[3] = doorbell_file;
for (int i = 0; i < 32; i++) {
if (strncmp(array[i], "", 1) != 0) {

View File

@ -8,8 +8,8 @@ set -e
pkill psa_server || true
# Remove temporary files and logs
rm -f psa_notify_*
rm -f psa_service_*
rm -f /tmp/psa_notify_*
rm -f /tmp/psa_service_*
rm -f psa_server.log
# Remove all IPCs

View File

@ -8,7 +8,7 @@ set -e
# The server creates some local files when it starts up so we can wait for this
# event as signal that the server is ready so that we can start client(s).
function wait_for_server_startup() {
while [ $(find . -name "psa_notify_*" | wc -l) -eq 0 ]; do
while [ -z $(find /tmp -maxdepth 1 -name "psa_notify_*" -printf 1 -quit) ]; do
sleep 0.1
done
}