-static int mount_find_pri(struct mntent *me, int *ret) {
- char *end, *opt;
- unsigned long r;
-
- assert(me);
- assert(ret);
-
- opt = hasmntopt(me, "pri");
- if (!opt)
- return 0;
-
- opt += strlen("pri");
- if (*opt != '=')
- return -EINVAL;
-
- errno = 0;
- r = strtoul(opt + 1, &end, 10);
- if (errno > 0)
- return -errno;
-
- if (end == opt + 1 || (*end != ',' && *end != 0))
- return -EINVAL;
-
- *ret = (int) r;
- return 1;
-}
-