Age | Commit message (Collapse) | Author |
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: Robin Kuck <robin@basicinside.de>
|
|
|
|
weneed to make sure that we do not run into a deadlock.
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: Markus Stenberg <markus.stenberg@iki.fi>
|
|
When running askfirst on an unused tty device askfirst starts
busylooping forever. Fix this by returning an error if we read
an EOF.
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
|
|
The unistd.h header is inluded twice.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Currently the last event timer for hotplug is
started after the udevtrigger process is forked.
Starting the timer means that the first hotplug
event must come in before the timer expires.
During this time the kernel must load the binary
of the udevtrigger from the underlying rootfs
which can be time consuming on slow systems.
On such systems, the timer expires before the
first hotplug event happens which results in
broken behaviour. Due to the missing device nodes,
not the ubus nor the procd code works correctly in
that case.
Change the code to only start the hotplug last
event timer after the udevtrigger process finishes.
This ensures that the delay caused by accessing the
underlying filesystem does not affects the desired
behaviour.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
These functions are simple wrappers around the
'scan_subdir' function. Remove the wrapper code and
use the 'scan_subdir' function directly instead.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Remove the local directory scanning code and
use the scan_subdir function instead.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Remove the local directory scanning code and
use the scan_subdir function instead.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Remove the local directory scanning code and
use the scan_subdir function instead.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Add more arguments to the function to make it
usable recursively.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Use the "/sys/class/block" string directly
for the stat call. This makes the code simpler
and reduces stack usage.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
It has been accidentally removed by:
commit 824a4b3da2c0be19ccf54a48dcd4c10677b82c1a
Author: Gabor Juhos <juhosg@openwrt.org>
Date: Tue Sep 10 12:59:25 2013 +0200
udevtrigger: reduce indent level in scan_* functions
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Return early from the scan_* functions if the
opendir call fails. This allows to reduce the
indentation level of the subsequent code by
one tab.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
There are only one variable present for a given
type. Remove the '2' suffix from the variable
names. Also rename the function argument to avoid
name collision.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
The scan_{block,class,subsystem} functions are using
identical code for scanning. Move that into a separate
function to avoid code duplication.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
The presence of the 'uevent' attribute file
does not always mean that a corresponding
device node can be created under '/dev'.
For valid device nodes, a 'dev' attribute
file must be present which cntains the major
and minor numbers of the device.
Modify the code to check the presence of the
dev attribute as well. This allows to avoid
superfluous trigger_uevent calls. On a test
system, the patch reduced the number of the
triegger_uevent calls from 144 to 70.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Move the code from device_list_insert() into
a separate function. This makes it possible
to reuse the code for other attribute files.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
http://patchwork.openwrt.org/patch/3978/
Signed-off-by: Mike Brady<mikebrady@eircom.net>
|
|
|
|
|
|
'dup2' will do it for us if necessary.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
Matching empty string makes rm_so and rm_eo of struct regmatch_t have
the same value, in this case both of them are 11. This causes a call to
atoi("\0") whose return value 0 is just the initial value of 'debug'.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
Since mkdev("*", 0600) has been called in early_dev just before
early_console, no need to try checking it again.
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
|
|
'man dup2' says:
dup2() makes newfd be the copy of oldfd, closing newfd first if
necessary, but note the following:
* If oldfd is not a valid file descriptor, then the call fails,
and newfd is not closed.
* If oldfd is a valid file descriptor, and newfd has the same
value as oldfd, then dup2() does nothing, and returns newfd.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
At the end of the 'early_console' function, the
file descriptor is closed unconditionally. This
'close' call closes the stdio files if the fd
returned by the 'open(dev/console)' call equals
with any of the STD{IN,OUT,ERR}_FILENO values.
When this happens, all subsequent accesses to
the stdio files will fail and early console
access won't work.
To avoid this, don't close the file descriptor if
that equals with any of the STD*_FILENO values.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|
|
Signed-off-by: John Crispin <blogic@openwrt.org>
|