diff options
author | James <> | 2013-03-17 12:16:37 +0000 |
---|---|---|
committer | James <> | 2013-03-17 12:16:37 +0000 |
commit | 27b76ab0671089c47506615a796a261e993896a7 (patch) | |
tree | 61213d67e7fa87b20356b23798558e2c4212c42f /package/libs/sysfsutils/patches/.svn | |
download | trunk-36060-master.tar.gz trunk-36060-master.tar.bz2 trunk-36060-master.zip |
Diffstat (limited to 'package/libs/sysfsutils/patches/.svn')
-rw-r--r-- | package/libs/sysfsutils/patches/.svn/entries | 62 | ||||
-rw-r--r-- | package/libs/sysfsutils/patches/.svn/text-base/200-mnt_path_check.patch.svn-base | 55 |
2 files changed, 117 insertions, 0 deletions
diff --git a/package/libs/sysfsutils/patches/.svn/entries b/package/libs/sysfsutils/patches/.svn/entries new file mode 100644 index 0000000..3c42643 --- /dev/null +++ b/package/libs/sysfsutils/patches/.svn/entries @@ -0,0 +1,62 @@ +10 + +dir +36060 +svn://svn.openwrt.org/openwrt/trunk/package/libs/sysfsutils/patches +svn://svn.openwrt.org/openwrt + + + +2010-02-27T08:22:13.277208Z +19881 +spudz76 + + + + + + + + + + + + + + +3c298f89-4303-0410-b956-a3cf2f4a3e73 + +200-mnt_path_check.patch +file + + + + +2013-03-17T12:13:06.000000Z +7961a1b78c29a67dd145103f222576f1 +2010-02-27T08:22:13.277208Z +19881 +spudz76 + + + + + + + + + + + + + + + + + + + + + +1245 + diff --git a/package/libs/sysfsutils/patches/.svn/text-base/200-mnt_path_check.patch.svn-base b/package/libs/sysfsutils/patches/.svn/text-base/200-mnt_path_check.patch.svn-base new file mode 100644 index 0000000..8710578 --- /dev/null +++ b/package/libs/sysfsutils/patches/.svn/text-base/200-mnt_path_check.patch.svn-base @@ -0,0 +1,55 @@ +--- a/lib/sysfs_utils.c ++++ b/lib/sysfs_utils.c +@@ -22,6 +22,7 @@ + */ + #include "libsysfs.h" + #include "sysfs.h" ++#include <mntent.h> + + /** + * sysfs_remove_trailing_slash: Removes any trailing '/' in the given path +@@ -53,6 +54,9 @@ int sysfs_get_mnt_path(char *mnt_path, s + { + static char sysfs_path[SYSFS_PATH_MAX] = ""; + const char *sysfs_path_env; ++ FILE *mnt; ++ struct mntent *mntent; ++ int ret; + + if (len == 0 || mnt_path == NULL) + return -1; +@@ -64,12 +68,31 @@ int sysfs_get_mnt_path(char *mnt_path, s + if (sysfs_path_env != NULL) { + safestrcpymax(mnt_path, sysfs_path_env, len); + sysfs_remove_trailing_slash(mnt_path); +- return 0; ++ } else { ++ safestrcpymax(mnt_path, SYSFS_MNT_PATH, len); + } +- safestrcpymax(mnt_path, SYSFS_MNT_PATH, len); + } + +- return 0; ++ /* check that mount point is indeed mounted */ ++ ret = -1; ++ if ((mnt = setmntent(SYSFS_PROC_MNTS, "r")) == NULL) { ++ dprintf("Error getting mount information\n"); ++ return -1; ++ } ++ while ((mntent = getmntent(mnt)) != NULL) { ++ if (strcmp(mntent->mnt_type, SYSFS_FSTYPE_NAME) == 0 && ++ strcmp(mntent->mnt_dir, mnt_path) == 0) { ++ ret = 0; ++ break; ++ } ++ } ++ ++ endmntent(mnt); ++ ++ if (ret < 0) ++ errno = ENOENT; ++ ++ return ret; + } + + /** |