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