summaryrefslogtreecommitdiffstats
path: root/src/udev/udev-event.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* udev: event - move renaming of udev_device to libudevTom Gundersen2015-01-261-13/+15
| | | | | This is not exposed in the public API. We want to simplify the internal libudev-device API as much as possible so that it will be simpler to rip the whole thing out in the future.
* Assorted format fixesZbigniew Jędrzejewski-Szmek2015-01-221-10/+10
| | | | | Types used for pids and uids in various interfaces are unpredictable. Too bad.
* treewide: use log_*_errno whenever %m is in the format stringMichal Schmidt2014-11-281-12/+12
| | | | | | | | | | | If the format string contains %m, clearly errno must have a meaningful value, so we might as well use log_*_errno to have ERRNO= logged. Using: find . -name '*.[ch]' | xargs sed -r -i -e \ 's/log_(debug|info|notice|warning|error|emergency)\((".*%m.*")/log_\1_errno(errno, \2/' Plus some whitespace, linewrap, and indent adjustments.
* treewide: yet more log_*_errno + return simplificationsMichal Schmidt2014-11-281-4/+2
| | | | | | | | | | | | | Using: find . -name '*.[ch]' | while read f; do perl -i.mmm -e \ 'local $/; local $_=<>; s/(if\s*\([^\n]+\))\s*{\n(\s*)(log_[a-z_]*_errno\(\s*([->a-zA-Z_]+)\s*,[^;]+);\s*return\s+\g4;\s+}/\1\n\2return \3;/msg; print;' $f done And a couple of manual whitespace fixups.
* udev,update-done: more log_xyz_errno() conversionsLennart Poettering2014-11-281-2/+1
|
* treewide: drop unnecessary trailing \n in log_*() callsMichal Schmidt2014-11-281-1/+1
|
* udev: support ENV{}=="" global property matchesKay Sievers2014-11-131-5/+12
|
* udev: switch to systemd logging functionsKay Sievers2014-11-131-3/+2
|
* udev: fix path for database names on 'change' eventRobert Milasan2014-09-181-0/+1
| | | | | | | | | | | If a device does not have a major/minor number attached, we use different database names than if it does. On "change" events, we didn't copy the devnum over, therefore, we used different paths than on 'add' or 'remove' events (where devnum was properly copied). Fix this by always copying the devnum into the udev-device. (David: added commit-log from email)
* udev: event - modernize spawn_exec()Tom Gundersen2014-09-171-9/+6
|
* udev: event - explicitly don't read() from invalid fdTom Gundersen2014-09-171-0/+3
| | | | This fixes CID #1237641.
* udev: event - modernize spawn_read()Tom Gundersen2014-09-171-25/+26
|
* udev: timeout - warn after a third of the timeout before killingTom Gundersen2014-09-111-10/+30
|
* udev: netif_rename - don't log to kmsgTom Gundersen2014-09-091-1/+1
| | | | As of 3.17, the kernel will do this on its own, so just do regular log_debug() logging from udev.
* udev: event - keep one rtnl per worker, rather than per eventTom Gundersen2014-09-091-15/+8
| | | | | | | | Creating the rtnl context is cheap, but freeing it may not be, due to synchronous close(). Also drop some excessive logging. We now log about the changing ifname exactly once.
* udev: import the full db on MOVE events for devices without dev_tTom Gundersen2014-09-091-0/+16
|
* udev: place opening { at the same line as the function declarationKay Sievers2014-07-291-14/+7
|
* udev: unify event timeout handlingKay Sievers2014-07-291-25/+28
|
* udev: do not skip the execution of RUN when renaming a network device failsKay Sievers2014-05-151-6/+5
|
* udev: rename netif - properly break lines in kmsgTom Gundersen2014-05-131-1/+1
| | | | | | | | | | | | | Before: 30,997,4553484,-;systemd-udevd[439]: renamed network interface wwan0 to wwp0s20u4i6systemd-udevd[439]: renamed network interface wlan0 to wlp3s0 30,998,1175077801,c;systemd-udevd[2345]: renamed network interface wwan0 to wwp0s20u4i6 After: 30,834,4553484,-;systemd-udevd[439]: renamed network interface wwan0 to wwp0s20u4i6 30,835,4732949,-;systemd-udevd[439]: renamed network interface wlan0 to wlp3s0 30,988,1175077801,-;systemd-udevd[2345]: renamed network interface wwan0 to wwp0s20u4i6
* udev: properly detect reference to unexisting part of PROGRAM's resultLukas Nykryn2014-03-111-0/+2
|
* api: in constructor function calls, always put the returned object pointer ↵Lennart Poettering2014-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* everywhere: make use of new0() and macro() macros, and stop using perror()Lennart Poettering2014-02-131-1/+1
|
* rtnl: drop "sd_" prefix from cleanup macrosLennart Poettering2014-02-131-1/+1
| | | | | | | | | 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.
* use memzero(foo, length); for all memset(foo, 0, length); callsGreg KH2014-01-311-2/+2
| | | | | | | | 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).
* log: log_error() and friends add a newline after each line anyway, so avoid ↵Lennart Poettering2013-12-241-31/+31
| | | | including it in the log strings
* udev: link-config - less verbose loggingTom Gundersen2013-10-301-1/+1
| | | | Also reinstate print to kmsg when renaming netif.
* udev: link-config - let udevd set the ifnameTom Gundersen2013-10-301-1/+1
|
* udev-event: use rtnl to set ifnameTom Gundersen2013-10-291-25/+21
|
* udev: support custom Linux Security Module labels for device nodesKay Sievers2013-10-081-1/+3
|
* udev: always set selinux label at "add" eventsKay Sievers2013-03-211-2/+4
| | | | https://bugs.freedesktop.org/show_bug.cgi?id=62615
* use streq instead of strcmpThomas Hindoe Paaboel Andersen2013-02-131-3/+3
|
* udev: set default rules permissions only at "add" eventsKay Sievers2013-01-271-2/+3
|
* udev: move string copy functions to shared/Kay Sievers2013-01-091-29/+29
|
* udev: in addition to DEVMODE, honor DEVUID, DEVGID from the ueventKay Sievers2012-12-311-0/+6
|
* udev: fix whitespaceKay Sievers2012-11-201-18/+18
|
* udev: properly handle symlink removal by 'change' eventKay Sievers2012-11-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* use the same email address everywhereKay Sievers2012-11-121-1/+1
|
* udev: use usec_t and now()Kay Sievers2012-11-121-6/+6
|
* udev: add missing newline when writing to /dev/kmsgKay Sievers2012-07-301-1/+1
|
* udev: get rid of TEST_PREFIX and use unshare() to fake /sys, /dev, /runKay Sievers2012-07-151-6/+6
|
* udev: avoid creating /dev/kmsg with fopen() to support CONFIG_PRINTK=nKay Sievers2012-07-141-8/+1
|
* udev: network device renaming - immediately give up if the target name isn't ↵Kay Sievers2012-07-051-60/+9
| | | | available
* udev: add some O_CLOEXECKay Sievers2012-07-051-1/+1
|
* udev: use startswith() and streq()Kay Sievers2012-04-161-1/+1
|
* udev: remove configuration options for /dev, /sys, /run directoriesKay Sievers2012-04-161-19/+11
|
* udev: replace ARRAY_SIZE() with ELEMENTSOF()Kay Sievers2012-04-161-3/+3
|
* udev: fix a few issues detected by the llvm static analyzerKay Sievers2012-04-131-2/+2
|
* udev: fix gcc warnings showing up after adding $(AM_CFLAGS)Kay Sievers2012-04-101-6/+2
|
* udev: remove RUN+="socket:.." and udev_monitor_new_from_netlink()Kay Sievers2012-04-091-8/+0
|