mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-25 23:21:33 +03:00
[PATCH] trivial cleanups and change some comments
This commit is contained in:
parent
45a7b668ec
commit
2af003feb2
11
udev.c
11
udev.c
@ -111,17 +111,22 @@ int main(int argc, char *argv[], char *envp[])
|
||||
act.sa_handler = (void (*) (int))sig_handler;
|
||||
sigemptyset (&act.sa_mask);
|
||||
act.sa_flags = 0;
|
||||
/* alarm must not restart syscalls*/
|
||||
sigaction(SIGALRM, &act, NULL);
|
||||
sigaction(SIGINT, &act, NULL);
|
||||
sigaction(SIGTERM, &act, NULL);
|
||||
|
||||
/* trigger timeout to interrupt blocking syscalls */
|
||||
/* trigger timeout to prevent hanging processes */
|
||||
alarm(ALARM_TIMEOUT);
|
||||
|
||||
action = getenv("ACTION");
|
||||
devpath = getenv("DEVPATH");
|
||||
subsystem = getenv("SUBSYSTEM");
|
||||
/* older kernels passed the SUBSYSTEM only as argument */
|
||||
if (!subsystem && argc == 2)
|
||||
subsystem = argv[1];
|
||||
udev_init_device(&udev, devpath, subsystem);
|
||||
|
||||
if (strstr(argv[0], "udevstart") || (argv[1] != NULL && strstr(argv[1], "udevstart"))) {
|
||||
if (strstr(argv[0], "udevstart") || (argc == 2 && strstr(argv[1], "udevstart"))) {
|
||||
dbg("udevstart");
|
||||
|
||||
/* disable all logging, as it's much too slow on some facilities */
|
||||
|
8
udev.h
8
udev.h
@ -50,14 +50,17 @@
|
||||
struct udevice {
|
||||
char devpath[DEVPATH_SIZE];
|
||||
char subsystem[SUBSYSTEM_SIZE];
|
||||
|
||||
char name[NAME_SIZE];
|
||||
char symlink[NAME_SIZE];
|
||||
char owner[OWNER_SIZE];
|
||||
char group[GROUP_SIZE];
|
||||
mode_t mode;
|
||||
char type;
|
||||
int major;
|
||||
int minor;
|
||||
mode_t mode;
|
||||
char symlink[NAME_SIZE];
|
||||
|
||||
char devname[NAME_SIZE];
|
||||
int partitions;
|
||||
int ignore_remove;
|
||||
int config_line;
|
||||
@ -67,7 +70,6 @@ struct udevice {
|
||||
char program_result[NAME_SIZE];
|
||||
char kernel_number[NAME_SIZE];
|
||||
char kernel_name[NAME_SIZE];
|
||||
char devname[NAME_SIZE];
|
||||
int test_run;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user