summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@suse.de>2005-11-09 09:53:32 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2005-11-09 09:53:32 -0800
commit54eb6a122fc6d2d765b9f71f9b47d529c1acf30f (patch)
treea70e2a564553f5b3ededc6b4f5864410d6d707ac
parent09c2bab517c58d9447660a9584822c8de6b641f0 (diff)
Make run_directory.c stat the place it is going to try to run.
This should remove a lot of error messages that people are seeing. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--extras/run_directory/run_directory.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/extras/run_directory/run_directory.c b/extras/run_directory/run_directory.c
index 5107f85aef..69faecc15e 100644
--- a/extras/run_directory/run_directory.c
+++ b/extras/run_directory/run_directory.c
@@ -53,9 +53,16 @@ static int exec_program(const char *filename, const char *subsystem)
int run_directory(const char *dir, const char *suffix, const char *subsystem)
{
struct name_entry *name_loop, *name_tmp;
+ struct stat buf;
LIST_HEAD(name_list);
dbg("looking at '%s'", dir);
+
+ if (stat(dir, &buf) != 0) {
+ dbg("directory '%s' not found", dir);
+ return 0;
+ }
+
add_matching_files(&name_list, dir, suffix);
list_for_each_entry_safe(name_loop, name_tmp, &name_list, node) {