#include #include "fsent.h" int __getfs_a(char const *spec, char const *file, struct fstab *fstab, char **line, size_t *size) { int r; int cs; pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &cs); FILE *f = fopen(_PATH_FSTAB, "rbe"); if (!f) { pthread_setcancelstate(cs, 0); return 0; } for (;;) { r = __getfsent_a(f, fstab, line, size); if (!r) break; if (spec && !strcmp(spec, fstab->fs_spec) || file && !strcmp(file, fstab->fs_file)) break; } __fclose_keep_errno(f); pthread_setcancelstate(cs, 0); return r; }