summaryrefslogtreecommitdiff
path: root/lib/libfrr.h
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2021-04-22 12:10:27 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2021-04-22 13:25:38 +0200
commit38554d3ae6c4ea553fd4e9ab2185c0d79f1144f7 (patch)
tree6220285e2cf240c271f63464bae64054039d02f3 /lib/libfrr.h
parent159246be247fd4332780fcafe5909874ae2c705a (diff)
lib: hard-fail creating threads before fork()
Creating any threads before we fork() into the background (if `-d` is given) is an extremely dangerous footgun; the threads are created in the parent and terminated when that exits. This is extra dangerous because while testing, you'd often run the daemon in foreground without `-d`, and everything works as expected. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/libfrr.h')
-rw-r--r--lib/libfrr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libfrr.h b/lib/libfrr.h
index 47ded8f313..3dc5d7af81 100644
--- a/lib/libfrr.h
+++ b/lib/libfrr.h
@@ -172,6 +172,8 @@ extern const char frr_scriptdir[];
extern char frr_protoname[];
extern char frr_protonameinst[];
+/* always set in the spot where we *would* fork even if we don't do so */
+extern bool frr_is_after_fork;
extern bool debug_memstats_at_exit;