X-Git-Url: https://gapil.gnulinux.it/gitweb/?p=gapil.git;a=blobdiff_plain;f=listati%2FReadMonitor.c;h=e057ee230b96404420a53d390df361ad4f7b1475;hp=888179515fa496fad315626ef85d759dbb223d7d;hb=d47f15496fa85c8ec22edcde608f2665ec5b95ae;hpb=b324b7a09e071b2f84a1849d109d4d14f27f44cd;ds=sidebyside diff --git a/listati/ReadMonitor.c b/listati/ReadMonitor.c index 8881795..e057ee2 100644 --- a/listati/ReadMonitor.c +++ b/listati/ReadMonitor.c @@ -3,17 +3,17 @@ int main(int argc, char *argv[]) key_t key; ... /* create needed IPC objects */ - key = ftok("~/gapil/sources/DirMonitor.c", 1); /* define a key */ - if (!(shmptr = ShmFind(key, 4096))) { /* get a shared memory segment */ + key = ftok("~/gapil/sources/DirMonitor.c", 1); /* define a key */ + if (!(shmptr = ShmFind(key, 4096))) { /* get a shared memory segment */ perror("Cannot find shared memory"); exit(1); } - if ((mutex = MutexFind(key)) == -1) { /* get the Mutex */ + if ((mutex = MutexFind(key)) == -1) { /* get the Mutex */ perror("Cannot find mutex"); exit(1); } /* main loop */ - MutexLock(mutex); /* lock shared memory */ + MutexLock(mutex); /* lock shared memory */ printf("Ci sono %d file dati\n", shmptr->tot_regular); printf("Ci sono %d directory\n", shmptr->tot_dir); printf("Ci sono %d link\n", shmptr->tot_link); @@ -23,5 +23,5 @@ int main(int argc, char *argv[]) printf("Ci sono %d device a blocchi\n", shmptr->tot_block); printf("Totale %d file, per %d byte\n", shmptr->tot_files, shmptr->tot_size); - MutexUnlock(mutex); /* unlock shared memory */ + MutexUnlock(mutex); /* unlock shared memory */ }