- if (kversion >= version && kpatchlevel >= patchlevel && ksublevel >= sublevel)
- return 1;
- else
- return 0;
-}
-
-int create_path(const char *path)
-{
- char p[NAME_SIZE];
- char *pos;
- struct stat stats;
-
- strcpy (p, path);
- pos = strrchr(p, '/');
- if (pos == p || pos == NULL)
- return 0;
-
- while (pos[-1] == '/')
- pos--;
-
- pos[0] = '\0';
-
- dbg("stat '%s'\n", p);
- if (stat (p, &stats) == 0 && (stats.st_mode & S_IFMT) == S_IFDIR)
- return 0;
-
- if (create_path (p) != 0)
- return -1;
-
- dbg("mkdir '%s'\n", p);
- return mkdir(p, 0755);
-}
-
-/* Reset permissions on the device node, before unlinking it to make sure,
- * that permisions of possible hard links will be removed to.
- */
-int unlink_secure(const char *filename)
-{
- int retval;
-
- retval = chown(filename, 0, 0);
- if (retval)
- dbg("chown(%s, 0, 0) failed with error '%s'", filename, strerror(errno));
-
- retval = chmod(filename, 0000);
- if (retval)
- dbg("chmod(%s, 0000) failed with error '%s'", filename, strerror(errno));
+ if (sort)
+ list_for_each_entry(loop_name, name_list, node) {
+ if (sort && strcmp(loop_name->name, name) > 0)
+ break;
+ }