X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=udev%2Flib%2Flibudev-monitor.c;h=c0aa99c65a668b4015b45a83ecac2e8613800ff6;hb=4061ab9f4bb0bdad3858e8ef1738dc892afe9de4;hp=f70bdb2d03b7ee5dc1b490dbf0c4f2d2a20c3840;hpb=c2654402790de8ba3e9f413ab1da0b18dd262317;p=elogind.git diff --git a/udev/lib/libudev-monitor.c b/udev/lib/libudev-monitor.c index f70bdb2d0..c0aa99c65 100644 --- a/udev/lib/libudev-monitor.c +++ b/udev/lib/libudev-monitor.c @@ -3,18 +3,10 @@ * * Copyright (C) 2008 Kay Sievers * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. */ #include @@ -54,7 +46,7 @@ struct udev_monitor { * socket will be used. * * The initial refcount is 1, and needs to be decremented to - * release the ressources of the udev monitor. + * release the resources of the udev monitor. * * Returns: a new udev monitor, or #NULL, in case of an error **/ @@ -94,7 +86,7 @@ struct udev_monitor *udev_monitor_new_from_socket(struct udev *udev, const char free(udev_monitor); return NULL; } - info(udev, "monitor %p created with '%s'\n", udev_monitor, socket_path); + dbg(udev, "monitor %p created with '%s'\n", udev_monitor, socket_path); return udev_monitor; } @@ -121,7 +113,7 @@ struct udev_monitor *udev_monitor_new_from_netlink(struct udev *udev) udev_monitor->snl.nl_pid = getpid(); udev_monitor->snl.nl_groups = 1; - info(udev, "monitor %p created with NETLINK_KOBJECT_UEVENT\n", udev_monitor); + dbg(udev, "monitor %p created with NETLINK_KOBJECT_UEVENT\n", udev_monitor); return udev_monitor; } @@ -136,7 +128,7 @@ int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor) err(udev_monitor->udev, "bind failed: %m\n"); return err; } - info(udev_monitor->udev, "monitor %p listening on netlink\n", udev_monitor); + dbg(udev_monitor->udev, "monitor %p listening on netlink\n", udev_monitor); } else if (udev_monitor->sun.sun_family != 0) { err = bind(udev_monitor->sock, (struct sockaddr *)&udev_monitor->sun, udev_monitor->addrlen); if (err < 0) { @@ -145,7 +137,7 @@ int udev_monitor_enable_receiving(struct udev_monitor *udev_monitor) } /* enable receiving of the sender credentials */ setsockopt(udev_monitor->sock, SOL_SOCKET, SO_PASSCRED, &on, sizeof(on)); - info(udev_monitor->udev, "monitor %p listening on socket\n", udev_monitor); + dbg(udev_monitor->udev, "monitor %p listening on socket\n", udev_monitor); } return 0; } @@ -178,7 +170,7 @@ struct udev_monitor *udev_monitor_ref(struct udev_monitor *udev_monitor) * @udev_monitor: udev monitor * * Drop a reference ofa udev monitor. If the refcount reaches zero, - * the bound socket will be closed, and the ressources of the monitor + * the bound socket will be closed, and the resources of the monitor * will be released. * **/ @@ -191,7 +183,7 @@ void udev_monitor_unref(struct udev_monitor *udev_monitor) return; if (udev_monitor->sock >= 0) close(udev_monitor->sock); - info(udev_monitor->udev, "monitor %p released\n", udev_monitor); + dbg(udev_monitor->udev, "monitor %p released\n", udev_monitor); free(udev_monitor); } @@ -233,11 +225,11 @@ int udev_monitor_get_fd(struct udev_monitor *udev_monitor) * device, fill in the received data, and return the device. * * Only socket connections with uid=0 are accepted. The caller - * needs to make sure, that there is data to read from the socket, - * the call will block until the socket becomes readable. + * needs to make sure that there is data to read from the socket. + * The call will block until the socket becomes readable. * * The initial refcount is 1, and needs to be decremented to - * release the ressources of the udev device. + * release the resources of the udev device. * * Returns: a new udev device, or #NULL, in case of an error **/ @@ -325,6 +317,8 @@ struct udev_device *udev_monitor_receive_device(struct udev_monitor *udev_monito } else if (strncmp(key, "SUBSYSTEM=", 10) == 0) { udev_device_set_subsystem(udev_device, &key[10]); subsystem_set = 1; + } else if (strncmp(key, "DEVTYPE=", 8) == 0) { + udev_device_set_devtype(udev_device, &key[8]); } else if (strncmp(key, "DEVNAME=", 8) == 0) { udev_device_set_devnode(udev_device, &key[8]); } else if (strncmp(key, "DEVLINKS=", 9) == 0) {