const char *special;
int skip = 0;
int pri = priority;
+ char *opt, *opts;
if (!streq(fstab->mnt_type, MNTTYPE_SWAP))
continue;
+ opts = strdup(fstab->mnt_opts);
+
+ for (opt = strtok(opts, ","); opt != NULL;
+ opt = strtok(NULL, ",")) {
+ if (strncmp(opt, "pri=", 4) == 0)
+ pri = atoi(opt+4);
+ if (strcmp(opt, "noauto") == 0)
+ skip = 1;
+ }
+ free(opts);
+
+ if (skip)
+ continue;
+
special = fsprobe_get_devname(fstab->mnt_fsname);
- if (!special)
+ if (!special) {
+ if (!ifexists)
+ status |= cannot_find(fstab->mnt_fsname);
continue;
+ }
if (!is_in_proc_swaps(special) &&
- (!ifexists || !access(special, R_OK))) {
- /* parse mount options; */
- char *opt, *opts = strdup(fstab->mnt_opts);
-
- for (opt = strtok(opts, ","); opt != NULL;
- opt = strtok(NULL, ",")) {
- if (strncmp(opt, "pri=", 4) == 0)
- pri = atoi(opt+4);
- if (strcmp(opt, "noauto") == 0)
- skip = 1;
- }
- if (!skip)
- status |= do_swapon(special, pri, CANONIC);
- }
+ (!ifexists || !access(special, R_OK)))
+ status |= do_swapon(special, pri, CANONIC);
+
+ free((void *) special);
}
fclose(fp);