From fb45b782f9ad70eb1110a9613991e1b7c8890689 Mon Sep 17 00:00:00 2001 From: mananth Date: Fri, 25 Nov 2005 14:10:44 +0000 Subject: Mohan's update to missing defn libsysfs.h --- include/libsysfs.h | 2 ++ lib/sysfs_utils.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/include/libsysfs.h b/include/libsysfs.h index 2cb9eb9..5a460eb 100644 --- a/include/libsysfs.h +++ b/include/libsysfs.h @@ -221,6 +221,8 @@ extern struct sysfs_attribute *sysfs_get_module_parm (struct sysfs_module *module, const char *parm); extern struct sysfs_attribute *sysfs_get_module_section (struct sysfs_module *module, const char *section); +extern struct sysfs_attribute *sysfs_open_module_attr(const char *module, + const char *attrib); /** * sort_list: sorter function to keep list elements sorted in alphabetical diff --git a/lib/sysfs_utils.c b/lib/sysfs_utils.c index 983cb2d..6397342 100644 --- a/lib/sysfs_utils.c +++ b/lib/sysfs_utils.c @@ -54,6 +54,9 @@ int sysfs_get_mnt_path(char *mnt_path, size_t len) static char sysfs_path[SYSFS_PATH_MAX] = ""; const char *sysfs_path_env; + if (len == 0 || mnt_path == NULL) + return -1; + /* evaluate only at the first call */ if (sysfs_path[0] == '\0') { /* possible overrride of real mount path */ -- cgit v1.2.1