【发布时间】:2014-03-03 17:50:07
【问题描述】:
我在 UBuntu 12.04 LTS 上工作。我正在尝试使用来自 site 的 sendsignal 和接收功能,但它们无法正常工作。在我的程序中,我首先调用 sendsignal("mySignal),然后调用 receive()。我得到以下信息:
Sending signal with value mySignal
Name Error(Connection ":1.95" is not allowed to own the service "test.signal.source" due to security policies in the configuration file)
因此,我在两个函数中都将 conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err); 替换为 conn = dbus_bus_get(DBUS_BUS_SESSION, &err);。现在发送了一个信号,但接收函数看不到该信号,即 NULL == msg 这是真的。由于以下错误,我还注释掉了dbus_connection_close(conn);:
process 12612: Applications must not close shared connections - see dbus_connection_close() docs. This is a bug in the application.
如何让它工作?
【问题讨论】:
-
还需要帮助吗?如果您尝试描述您从根本上想要实现的目标会更好。此外,如果您遇到权限问题,请尝试以 root 身份运行该程序。
标签: c ubuntu-12.04 dbus