mountpoint.c revision d8eedfaad386a8776e4931086b039b72e1ad38c4
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen/* Copyright (c) 2006 Timo Sirainen */
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen/* AIX doesn't have these defined */
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainenint mountpoint_get(const char *path, pool_t pool, struct mountpoint *point_r)
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen point_r->device_path = p_strdup(pool, buf.f_mntfromname);
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen point_r->mount_path = p_strdup(pool, buf.f_mntonname);
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen point_r->mount_path = p_strdup(pool, buf.f_fstypename);
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen /* Linux, Solaris: /etc/mtab reading */
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen const char *device_path = NULL, *mount_path = NULL, *type = NULL;
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen /* Solaris */
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen if (strcmp(ent.mnt_fstype, MNTTYPE_SWAP) == 0 ||
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen i_error("setmntent(%s) failed: %m", MTAB_PATH);
be6ad6e46ecb8c7126b421819046e7f4857a2babTimo Sirainen if (strcmp(ent->mnt_type, MNTTYPE_SWAP) == 0 ||
endmntent(f);