mountpoint.c revision ad3a1b8f8e2a5596afb1b099a69ae6f688887eec
c25356d5978632df6203437e1953bcb29e0c736fTimo Sirainen/* Copyright (c) 2006 Timo Sirainen */
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen/* AIX doesn't have these defined */
2615df45a8027948a474abe5e817b34b0499c171Timo Sirainenint mountpoint_get(const char *path, pool_t pool, struct mountpoint *point_r)
857c471c13ca215f4be9dd4b336b742b8d434e31Timo Sirainen point_r->device_path = p_strdup(pool, buf.f_mntfromname);
857c471c13ca215f4be9dd4b336b742b8d434e31Timo Sirainen point_r->mount_path = p_strdup(pool, buf.f_mntonname);
857c471c13ca215f4be9dd4b336b742b8d434e31Timo Sirainen point_r->type = p_strdup(pool, buf.f_fstypename);
fdc557286bc9f92c5f3bb49096ff6e2bcec0ea79Timo Sirainen /* Linux, Solaris: /etc/mtab reading */
563273bdac80393af63b9520cbf4d24cc0efd028Timo Sirainen const char *device_path = NULL, *mount_path = NULL, *type = NULL;
8b31f966d9688e07672ef1958dcbdb7686523c04Timo Sirainen /* Solaris */
d1e843e77f4760e303c53d9fce10123fc8d230a1Timo Sirainen if (strcmp(ent.mnt_fstype, MNTTYPE_SWAP) == 0 ||
306b3f41b05da642d87e7ca7a1496efce9f5902fTimo Sirainen i_error("setmntent(%s) failed: %m", MTAB_PATH);
306b3f41b05da642d87e7ca7a1496efce9f5902fTimo Sirainen if (strcmp(ent->mnt_type, MNTTYPE_SWAP) == 0 ||
539977f9257bd8985be5a8093658da266ae9cd19Timo Sirainen point_r->device_path = p_strdup(pool, device_path);