mirror of
https://github.com/edeproject/ede.git
synced 2023-08-10 21:13:03 +03:00
Allow only one instance of emountd
This commit is contained in:
parent
ffee0edd57
commit
8d6cb50fb7
@ -373,6 +373,15 @@ int main(int argc, char** argv) {
|
||||
|
||||
bus_connection = session_conn;
|
||||
|
||||
/*
|
||||
* make sure we are running only one instance; this is done by requesting ownership
|
||||
* of the interface name
|
||||
*/
|
||||
if(dbus_bus_request_name(bus_connection, EMOUNTD_INTERFACE, 0, 0) != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) {
|
||||
printf("One instance of emountd is already running! Balling out...\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
/* let libhal use our system bus connection */
|
||||
libhal_ctx_set_dbus_connection(ctx, conn);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user