]> git.itanic.dy.fi Git - buddywatch/commitdiff
Close file earlier master
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Tue, 6 Dec 2011 16:38:43 +0000 (18:38 +0200)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Tue, 6 Dec 2011 16:38:43 +0000 (18:38 +0200)
No need to keep the file open any longer than it is being read.

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
buddywatch.c

index ca44d39fc3d58bb5808f113dbc109694e598d60f..d08f55a41af8346f46c64c340531ab70b496daac 100644 (file)
@@ -59,6 +59,7 @@ int main(int argc, char *argv[])
                        for (i = 0; i < MAX_ORDER; i++)
                                buddy[i] += bud[i];
                }
+               fclose(file);
 
                tot = 0;
                for (i = 0; i < MAX_ORDER; i++)
@@ -95,8 +96,6 @@ int main(int argc, char *argv[])
                        tot >> 10);
 
                nanosleep(&sleep, NULL);
-
-               fclose(file);
        }
        return 0;
 }