]> git.itanic.dy.fi Git - rrdd/commitdiff
process: Remove get_sibling_count()
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 15 Apr 2012 17:26:02 +0000 (20:26 +0300)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Sun, 15 Apr 2012 17:26:02 +0000 (20:26 +0300)
This function does not really provide any useful information. It was
used only in the debug prints, where it was printed after the pid
number. However, it is much more useful to print the parent count
instead to see how deep we are in the fork chain.

Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
debug.h
process.c
process.h

diff --git a/debug.h b/debug.h
index 1411313f64c1ed0c412a45af1f3e59b797d06bba..ea6c69a8c9750b72910f14d0edae077af201feac 100644 (file)
--- a/debug.h
+++ b/debug.h
@@ -21,7 +21,7 @@ extern const char normal_color[];
                                                                        \
                fprintf(stderr, "%s%s %s[%5d.%d] %s:%d %s"              \
                        fmt, green_color, time, indent,                 \
-                       getpid(), get_sibling_count(),                  \
+                       getpid(), get_parent_count(),                   \
                        __FILE__, __LINE__, normal_color, ##arg);       \
        } while (0)
 
@@ -38,7 +38,7 @@ extern const char normal_color[];
                                                                        \
                fprintf(stderr, "%s%s %s[%5d.%d] %s:%d Error %s"        \
                        fmt, red_color, time, indent,                   \
-                       getpid(), get_sibling_count(),                  \
+                       getpid(), get_parent_count(),                   \
                        __FILE__, __LINE__, normal_color, ##arg);       \
        } while (0)
 
index a00d34e79092b2c7b21521387f646cd0531ab52f..0228dbaf45df67126a454a8acee2f64afc47977c 100644 (file)
--- a/process.c
+++ b/process.c
@@ -18,11 +18,6 @@ int get_parent_count(void)
        return parent_count;
 }
 
-int get_sibling_count(void)
-{
-       return process_count;
-}
-
 int do_fork(void)
 {
        int child;
@@ -38,7 +33,6 @@ int do_fork(void)
                return child;
        }
 
-       process_count = child_count;
        /* reset child's child count */
        child_count = 0;
        parent_count++;
index 547e42fca37635b2e7a5669cbf041f2f6a4d1896..9b8e40c0f272d6b5c41976c1eab93a8dee130392 100644 (file)
--- a/process.h
+++ b/process.h
@@ -11,7 +11,6 @@
 
 int get_child_count(void);
 int get_parent_count(void);
-int get_sibling_count(void);   /* Returns the number of older siblings */
 
 int do_fork(void);
 int run(const char *p, char *const argv[]);