chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[PATCH] 030 release
[elogind.git]
/
udev.c
diff --git
a/udev.c
b/udev.c
index 1220e637e5ce1befce760ac9231dbf2e95814bae..eb21f7546104b0b287afdaaffe7857205a749665 100644
(file)
--- a/
udev.c
+++ b/
udev.c
@@
-32,7
+32,6
@@
#include "udev.h"
#include "udev_lib.h"
#include "udev_version.h"
#include "udev.h"
#include "udev_lib.h"
#include "udev_version.h"
-#include "udev_dbus.h"
#include "logging.h"
#include "namedev.h"
#include "udevdb.h"
#include "logging.h"
#include "namedev.h"
#include "udevdb.h"
@@
-56,21
+55,19
@@
void log_message(int level, const char *format, ...)
}
#endif
}
#endif
-static void sig_handler(int signum)
+
__attribute__((regparm(0)))
static void sig_handler(int signum)
{
switch (signum) {
case SIGINT:
case SIGTERM:
{
switch (signum) {
case SIGINT:
case SIGTERM:
- sysbus_disconnect();
udevdb_exit();
exit(20 + signum);
default:
udevdb_exit();
exit(20 + signum);
default:
- dbg("unhandled signal
"
);
+ dbg("unhandled signal
%d", signum
);
}
}
static char *subsystem_blacklist[] = {
}
}
static char *subsystem_blacklist[] = {
- "net",
"scsi_host",
"scsi_device",
"usb_host",
"scsi_host",
"scsi_device",
"usb_host",
@@
-87,6
+84,7
@@
static int udev_hotplug(void)
int retval = -EINVAL;
int i;
struct sigaction act;
int retval = -EINVAL;
int i;
struct sigaction act;
+ const int nofake = 0;
action = get_action();
if (!action) {
action = get_action();
if (!action) {
@@
-123,17
+121,14
@@
static int udev_hotplug(void)
i++;
}
i++;
}
- /* connect to the system message bus */
- sysbus_connect();
-
/* initialize udev database */
retval = udevdb_init(UDEVDB_DEFAULT);
if (retval != 0) {
dbg("unable to initialize database");
/* initialize udev database */
retval = udevdb_init(UDEVDB_DEFAULT);
if (retval != 0) {
dbg("unable to initialize database");
- goto exit
_sysbus
;
+ goto exit;
}
}
- /* set
up a default signal handler for now
*/
+ /* set
signal handlers
*/
act.sa_handler = sig_handler;
sigemptyset (&act.sa_mask);
act.sa_flags = SA_RESTART;
act.sa_handler = sig_handler;
sigemptyset (&act.sa_mask);
act.sa_flags = SA_RESTART;
@@
-142,27
+137,23
@@
static int udev_hotplug(void)
if (strcmp(action, "add") == 0) {
namedev_init();
if (strcmp(action, "add") == 0) {
namedev_init();
- retval = udev_add_device(devpath, subsystem, 0);
- } else {
- if (strcmp(action, "remove") == 0) {
- retval = udev_remove_device(devpath, subsystem);
- } else {
- dbg("unknown action '%s'", action);
- retval = -EINVAL;
- }
+ retval = udev_add_device(devpath, subsystem, nofake);
+ goto action_done;
}
}
- udevdb_exit();
+ if (strcmp(action, "remove") == 0) {
+ retval = udev_remove_device(devpath, subsystem);
+ goto action_done;
+ }
-exit_sysbus:
- /* disconnect from the system message bus */
- sysbus_disconnect();
+ dbg("unknown action '%s'", action);
+ retval = -EINVAL;
-exit:
- if (retval > 0)
- retval = 0;
+action_done:
+ udevdb_exit();
- return -retval;
+exit:
+ return retval;
}
int main(int argc, char *argv[], char *envp[])
}
int main(int argc, char *argv[], char *envp[])