summaryrefslogtreecommitdiff
path: root/src/udev/udev-event.c
AgeCommit message (Collapse)Author
2014-03-11udev: properly detect reference to unexisting part of PROGRAM's resultLukas Nykryn
2014-02-20api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering
first (or second) Previously the returned object of constructor functions where sometimes returned as last, sometimes as first and sometimes as second parameter. Let's clean this up a bit. Here are the new rules: 1. The object the new object is derived from is put first, if there is any 2. The object we are creating will be returned in the next arguments 3. This is followed by any additional arguments Rationale: For functions that operate on an object we always put that object first. Constructors should probably not be too different in this regard. Also, if the additional parameters might want to use varargs which suggests to put them last. Note that this new scheme only applies to constructor functions, not to all other functions. We do give a lot of freedom for those. Note that this commit only changes the order of the new functions we added, for old ones we accept the wrong order and leave it like that.
2014-02-13everywhere: make use of new0() and macro() macros, and stop using perror()Lennart Poettering
2014-02-13rtnl: drop "sd_" prefix from cleanup macrosLennart Poettering
The "sd_" prefix is supposed to be used on exported symbols only, and not in the middle of names. Let's drop it from the cleanup macros hence, to make things simpler. The bus cleanup macros don't carry the "sd_" either, so this brings the APIs a bit nearer.
2014-01-31use memzero(foo, length); for all memset(foo, 0, length); callsGreg KH
In trying to track down a stupid linker bug, I noticed a bunch of memset() calls that should be using memzero() to make it more "obvious" that the options are correct (i.e. 0 is not the length, but the data to set). So fix up all current calls to memset(foo, 0, length) to memzero(foo, length).
2013-12-24log: log_error() and friends add a newline after each line anyway, so avoid ↵Lennart Poettering
including it in the log strings
2013-10-30udev: link-config - less verbose loggingTom Gundersen
Also reinstate print to kmsg when renaming netif.
2013-10-30udev: link-config - let udevd set the ifnameTom Gundersen
2013-10-29udev-event: use rtnl to set ifnameTom Gundersen
2013-10-08udev: support custom Linux Security Module labels for device nodesKay Sievers
2013-03-21udev: always set selinux label at "add" eventsKay Sievers
https://bugs.freedesktop.org/show_bug.cgi?id=62615
2013-02-13use streq instead of strcmpThomas Hindoe Paaboel Andersen
2013-01-27udev: set default rules permissions only at "add" eventsKay Sievers
2013-01-09udev: move string copy functions to shared/Kay Sievers
2012-12-31udev: in addition to DEVMODE, honor DEVUID, DEVGID from the ueventKay Sievers
2012-11-20udev: fix whitespaceKay Sievers
2012-11-13udev: properly handle symlink removal by 'change' eventKay Sievers
If a 'change' event is supposed to remove created symlinks, we create a new device structure from the sysfs device and fill it with the list of links, to compute the delta of the old and new list of links to apply. If the device is already 'remove'd by the kernel though, udev fails to create the device structure, so the links are not removed properly. > From: Neil Brown <nfbrown@suse.com> > Date: Thu, 8 Nov 2012 10:39:06 +0100 > Subject: [PATCH] If a 'change' event does not get handled by udev until > after the device has subsequently disappeared, udev mis-handles > it. This can happen with 'md' devices which emit a change > event and then a remove event when they are stopped. It is > normally only noticed if udev is very busy (lots of arrays > being stopped at once) or the machine is otherwise loaded > and reponding slowly. > > There are two problems. > > 1/ udev_device_new_from_syspath() will refuse to create the device > structure if the device does not exist in /sys, and particularly if > the uevent file does not exist. > If a 'db' file does exist, that is sufficient evidence that the device > is genuine and should be created. Equally if we have just received an > event from the kernel about the device, it must be real. > > This patch just disabled the test for the 'uevent' file, it doesn't > try imposing any other tests - it isn't clear that they are really > needed. > > 2/ udev_event_execute_rules() calls udev_device_read_db() on a 'device' > structure that is largely uninitialised and in particular does not > have the 'subsystem' set. udev_device_read_db() needs the subsystem > so it tries to read the 'subsystem' symlink out of sysfs. If the > device is already deleted, this naturally fails. > udev_event_execute_rules() knows the subsystem (as it was in the > event message) so this patch simply sets the subsystem for the device > structure to be loaded to match the subsystem of the device structure > that is handling the event. > > With these two changes, deleted handling of change events will still > correctly remove any symlinks that are not needed any more. Use udev_device_new() instead of allowing udev_device_new_from_syspath() to proceed without a sysfs device.
2012-11-12use the same email address everywhereKay Sievers
2012-11-12udev: use usec_t and now()Kay Sievers
2012-07-30udev: add missing newline when writing to /dev/kmsgKay Sievers
2012-07-15udev: get rid of TEST_PREFIX and use unshare() to fake /sys, /dev, /runKay Sievers
2012-07-14udev: avoid creating /dev/kmsg with fopen() to support CONFIG_PRINTK=nKay Sievers
2012-07-05udev: network device renaming - immediately give up if the target name isn't ↵Kay Sievers
available
2012-07-05udev: add some O_CLOEXECKay Sievers
2012-04-16udev: use startswith() and streq()Kay Sievers
2012-04-16udev: remove configuration options for /dev, /sys, /run directoriesKay Sievers
2012-04-16udev: replace ARRAY_SIZE() with ELEMENTSOF()Kay Sievers
2012-04-13udev: fix a few issues detected by the llvm static analyzerKay Sievers
2012-04-10udev: fix gcc warnings showing up after adding $(AM_CFLAGS)Kay Sievers
2012-04-09udev: remove RUN+="socket:.." and udev_monitor_new_from_netlink()Kay Sievers
2012-04-09udev: convert 'uaccess' to a builtinKay Sievers
2012-04-08udev: switch to systemd logging functionsKay Sievers
2012-04-04move imported udev into placeKay Sievers