summary refs log tree commit diff
path: root/src/platform/tests/monitor.c
blob: 9aff1047638d3abf754dea81889bdbee1e67250e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "config.h"

#include <stdlib.h>
#include <syslog.h>

#include "nm-fake-platform.h"
#include "nm-linux-platform.h"
#include "nm-logging.h"

int
main (int argc, char **argv)
{
	GMainLoop *loop;

#if !GLIB_CHECK_VERSION (2, 35, 0)
	g_type_init ();
#endif

	loop = g_main_loop_new (NULL, FALSE);
	nm_logging_setup ("debug", NULL, NULL, NULL);
	openlog (G_LOG_DOMAIN, LOG_CONS | LOG_PERROR, LOG_DAEMON);

	g_assert (argc <= 2);
	if (argc > 1 && !g_strcmp0 (argv[1], "--fake"))
		nm_fake_platform_setup ();
	else
		nm_linux_platform_setup ();

	g_main_loop_run (loop);

	return EXIT_SUCCESS;
}