If only ext4 is available (as a module or in /proc/filesystems)
blkid wasn't properly testing for it, because the time checks
were backwards and always failed. This caused old ext4dev
filesystems to fail to mount as ext4. With this patch it works
fine.
Also, don't try to check for modules on a non-Linux system.
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
#ifdef HAVE_SYS_MKDEV_H
#include <sys/mkdev.h>
#endif
+#ifdef __linux__
#include <sys/utsname.h>
+#endif
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
*/
static int check_for_modules(const char *fs_name)
{
+#ifdef __linux__
struct utsname uts;
FILE *f;
char buf[1024], *cp, *t;
return (1);
}
fclose(f);
+#endif
return (0);
}
static int ret = -1;
time_t now = time(0);
- if (ret != -1 || (last_check - now) < 5)
+ if (ret != -1 || (now - last_check) < 5)
return ret;
last_check = now;
ret = (fs_proc_check("ext4") || check_for_modules("ext4"));
static int ret = -1;
time_t now = time(0);
- if (ret != -1 || (last_check - now) < 5)
+ if (ret != -1 || (now - last_check) < 5)
return ret;
last_check = now;
ret = (fs_proc_check("ext4dev") || check_for_modules("ext4dev"));