refactor: swapped shmid & address positions in prints
This commit is contained in:
parent
f7ce4792ed
commit
259a47dc11
4
init.c
4
init.c
@ -76,8 +76,8 @@ void write_mem_segment(int priorities[]) {
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("[INIT] Connected to shared segment at %p (%d)\n", (void *)&shm_array,
|
||||
shmid);
|
||||
printf("[INIT] Connected to shared segment %d (%p)\n", shmid,
|
||||
(void *)&shm_array);
|
||||
|
||||
// Write
|
||||
for (int i = 0; i < NUM_PROCS; i++) {
|
||||
|
@ -36,8 +36,8 @@ int main() {
|
||||
|
||||
// Creation and attaching into a new shared segment
|
||||
int shmid = create_mem_segment(&shm_array);
|
||||
printf("[SCHEDULER] Shared segment created at %p (%d)\n", (void *)shm_array,
|
||||
shmid);
|
||||
printf("[SCHEDULER] Shared segment %d created (%p)\n", shmid,
|
||||
(void *)shm_array);
|
||||
|
||||
// Wait until init has finished writing into the segment
|
||||
printf("[SCHEDULER] Sleeping for %d seconds before reading\n", delay);
|
||||
|
Loading…
Reference in New Issue
Block a user