On Mon, Jul 15, 2013 at 8:11 AM, Dave Reisner <d@xxxxxxxxxxxxxx> wrote: > > On Jul 15, 2013 1:13 AM, "Lucas De Marchi" <lucas.demarchi@xxxxxxxxxxxxxx> > wrote: >> >> From: Lucas De Marchi <lucas.demarchi@xxxxxxxxx> >> >> --- >> Makefile.am | 1 - >> libkmod/libkmod-util.c | 64 ++++++++++++++++++++++++++++++++++++ >> libkmod/libkmod-util.h | 1 + >> testsuite/init_module.c | 1 - >> testsuite/mkdir.c | 86 >> ------------------------------------------------- >> testsuite/mkdir.h | 24 -------------- >> 6 files changed, 65 insertions(+), 112 deletions(-) >> delete mode 100644 testsuite/mkdir.c >> delete mode 100644 testsuite/mkdir.h >> >> diff --git a/Makefile.am b/Makefile.am >> index 0ed944c..57b7372 100644 >> --- a/Makefile.am >> +++ b/Makefile.am >> @@ -154,7 +154,6 @@ testsuite_path_la_LDFLAGS = >> $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) >> testsuite_delete_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) >> testsuite_init_module_la_LDFLAGS = $(TESTSUITE_OVERRIDE_LIBS_LDFLAGS) >> testsuite_init_module_la_SOURCES = testsuite/init_module.c \ >> - testsuite/mkdir.c testsuite/mkdir.h \ >> testsuite/stripped-module.h >> testsuite_init_module_la_LIBADD = libkmod/libkmod-internal.la >> >> diff --git a/libkmod/libkmod-util.c b/libkmod/libkmod-util.c >> index e636ae1..5c680e7 100644 >> --- a/libkmod/libkmod-util.c >> +++ b/libkmod/libkmod-util.c >> @@ -2,6 +2,8 @@ >> * libkmod - interface to kernel module operations >> * >> * Copyright (C) 2011-2013 ProFUSION embedded systems >> + * Copyright (C) 2013 Intel Corporation. All rights reserved. >> + * Copyright (C) 2012 Lucas De Marchi <lucas.de.marchi@xxxxxxxxx> >> * >> * This library is free software; you can redistribute it and/or >> * modify it under the terms of the GNU Lesser General Public >> @@ -308,6 +310,68 @@ char *path_make_absolute_cwd(const char *p) >> return r; >> } >> >> +static inline int is_dir(const char *path) >> +{ >> + struct stat st; >> + >> + if (stat(path, &st) >= 0) { >> + if (S_ISDIR(st.st_mode)) >> + return 1; >> + return 0; > > Why not just return S_ISDIR(st.st_mode); I can just blame lack of caffeine ;-). I will change it before pushing. Thanks Lucas De Marchi -- To unsubscribe from this list: send the line "unsubscribe linux-modules" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html