summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-01-05 05:31:42 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:19:09 -0700
commitd3c3763530955a898e1d50c6844765e94ac957c2 (patch)
tree8bc53bdd579f12204e9e68cdffc79c1dd659ad0f
parent3908058c10dea619e1c676ee8a167ef3e590a3bd (diff)
[PATCH] correct detection of hotplug.d/ udevsend loop
If udevsend is called from the commandline the env may be too big to fit in our buffer and we tag the message.
-rw-r--r--udevsend.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/udevsend.c b/udevsend.c
index 05a50facc5..d86004ba3b 100644
--- a/udevsend.c
+++ b/udevsend.c
@@ -148,10 +148,6 @@ int main(int argc, char *argv[], char *envp[])
key = envp[i];
keylen = strlen(key);
- if (bufpos + keylen >= HOTPLUG_BUFFER_SIZE-1) {
- dbg("environment buffer too small, probably not called by the kernel");
- continue;
- }
/* prevent loops in the scripts we execute */
if (strncmp(key, "UDEVD_EVENT=", 12) == 0) {
@@ -159,6 +155,11 @@ int main(int argc, char *argv[], char *envp[])
goto exit;
}
+ if (bufpos + keylen >= HOTPLUG_BUFFER_SIZE-1) {
+ dbg("environment buffer too small, probably not called by the kernel");
+ continue;
+ }
+
/* remember the SUBSYSTEM */
if (strncmp(key, "SUBSYSTEM=", 10) == 0)
subsystem = &key[10];