Files
RedBear-OS/local/recipes/libs/glib/source/gio/tests/gdbus-daemon.c
T
vasilito cee25393d8 fix: boot process improvements — dependency cycle, INIT_NOTIFY, probing loop, and log spam fixes
- Fix P15-8-init-cycle-detection.patch: replace visiting+error with seen+silent-skip
  to eliminate 11 false-positive 'dependency cycle detected' errors on shared deps
- Fix P0-daemon-fix-init-notify-unwrap.patch: remove eprintln! for missing
  INIT_NOTIFY (expected for oneshot_async services, ~7 daemons affected)
- Fix driver-manager hotplug loop: add PERMANENTLY_SKIPPED static set shared
  between hotplug handler and DriverConfig::probe() to stop infinite re-probing
  of Fatal/NotSupported/deferred-exhausted device+driver pairs (e.g. ided)
- Fix driver-manager log_timeline: suppress repeated EPIPE/ENOENT errors with
  AtomicI32 dedup and AtomicBool one-shot guards for boot timeline JSON
- Add driver-manager SIGTERM handler, ACPI bus registration, --status mode,
  driver reap loop, graceful shutdown, and reduced deferred retries (30→3)
2026-05-17 12:34:02 +03:00

71 lines
1.8 KiB
C

#include "config.h"
#include "gdbusdaemon.h"
#include <glib/gi18n.h>
int
main (int argc, char *argv[])
{
GDBusDaemon *daemon;
GMainLoop *loop;
const char *address = NULL;
const char *config_file = NULL;
GError *error = NULL;
gboolean print_address = FALSE;
gboolean print_env = FALSE;
GOptionContext *context;
GOptionEntry entries[] = {
{ "address", 0, 0, G_OPTION_ARG_STRING, &address, N_("Address to listen on"), NULL },
{ "config-file", 0, 0, G_OPTION_ARG_STRING, &config_file, N_("Ignored, for compat with GTestDbus"), NULL },
{ "print-address", 0, 0, G_OPTION_ARG_NONE, &print_address, N_("Print address"), NULL },
{ "print-env", 0, 0, G_OPTION_ARG_NONE, &print_env, N_("Print address in shell mode"), NULL },
G_OPTION_ENTRY_NULL
};
context = g_option_context_new ("");
g_option_context_set_translation_domain (context, GETTEXT_PACKAGE);
g_option_context_set_summary (context,
N_("Run a dbus service"));
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
error = NULL;
if (!g_option_context_parse (context, &argc, &argv, &error))
{
g_printerr ("%s\n", error->message);
return 1;
}
g_option_context_free (context);
if (argc != 1)
{
g_printerr (_("Wrong args\n"));
return 1;
}
loop = g_main_loop_new (NULL, FALSE);
if (argc >= 2)
address = argv[1];
daemon = _g_dbus_daemon_new (address, NULL, &error);
if (daemon == NULL)
{
g_printerr ("Can't init bus: %s\n", error->message);
return 1;
}
if (print_env)
g_print ("export DBUS_SESSION_BUS_ADDRESS=\"%s\"\n", _g_dbus_daemon_get_address (daemon));
if (print_address)
g_print ("%s\n", _g_dbus_daemon_get_address (daemon));
g_main_loop_run (loop);
g_main_loop_unref (loop);
return 0;
}