refactor: swapped shmid & address positions in prints

This commit is contained in:
ae 2024-10-14 12:09:08 +03:00
parent f7ce4792ed
commit 259a47dc11
Signed by: ae
GPG Key ID: 995EFD5C1B532B3E
2 changed files with 4 additions and 4 deletions

4
init.c
View File

@ -76,8 +76,8 @@ void write_mem_segment(int priorities[]) {
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
printf("[INIT] Connected to shared segment at %p (%d)\n", (void *)&shm_array, printf("[INIT] Connected to shared segment %d (%p)\n", shmid,
shmid); (void *)&shm_array);
// Write // Write
for (int i = 0; i < NUM_PROCS; i++) { for (int i = 0; i < NUM_PROCS; i++) {

View File

@ -36,8 +36,8 @@ int main() {
// Creation and attaching into a new shared segment // Creation and attaching into a new shared segment
int shmid = create_mem_segment(&shm_array); int shmid = create_mem_segment(&shm_array);
printf("[SCHEDULER] Shared segment created at %p (%d)\n", (void *)shm_array, printf("[SCHEDULER] Shared segment %d created (%p)\n", shmid,
shmid); (void *)shm_array);
// Wait until init has finished writing into the segment // Wait until init has finished writing into the segment
printf("[SCHEDULER] Sleeping for %d seconds before reading\n", delay); printf("[SCHEDULER] Sleeping for %d seconds before reading\n", delay);