Corretti i commenti ai listati in una forma piu' leggibile (spero).
[gapil.git] / listati / ReadMonitor.c
index 888179515fa496fad315626ef85d759dbb223d7d..e057ee230b96404420a53d390df361ad4f7b1475 100644 (file)
@@ -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 */
 }