#include <systemd/sd-event.h>
#include "daemon.h"
+#include "logging.h"
struct nw_daemon {
int nrefs;
// Fetch a reference to the default event loop
r = sd_event_default(&daemon->loop);
if (r < 0) {
- //ERROR("Could not setup event loop: %m\n");
+ ERROR("Could not setup event loop: %m\n");
return 1;
}
// Enable the watchdog
r = sd_event_set_watchdog(daemon->loop, 1);
if (r < 0) {
- //ERROR("Could not activate watchdog: %m\n");
+ ERROR("Could not activate watchdog: %m\n");
return 1;
}
// Launch the event loop
r = sd_event_loop(daemon->loop);
if (r) {
- //ERROR("Could not run the event loop: %m\n");
+ ERROR("Could not run the event loop: %m\n");
return r;
}
--- /dev/null
+/*#############################################################################
+# #
+# IPFire.org - A linux based firewall #
+# Copyright (C) 2023 IPFire Network Development Team #
+# #
+# This program is free software: you can redistribute it and/or modify #
+# it under the terms of the GNU General Public License as published by #
+# the Free Software Foundation, either version 3 of the License, or #
+# (at your option) any later version. #
+# #
+# This program is distributed in the hope that it will be useful, #
+# but WITHOUT ANY WARRANTY; without even the implied warranty of #
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #
+# GNU General Public License for more details. #
+# #
+# You should have received a copy of the GNU General Public License #
+# along with this program. If not, see <http://www.gnu.org/licenses/>. #
+# #
+#############################################################################*/
+
+#ifndef NETWORKD_LOGGING_H
+#define NETWORKD_LOGGING_H
+
+#include <stdio.h>
+
+/*
+ This is just something simple which will work for now...
+*/
+#define ERROR(...) fprintf(stderr, __VA_ARGS__)
+#define DEBUG(...) printf(__VA_ARGS__)
+
+#endif /* NETWORKD_LOGGING_H */