result r = E_SUCCESS;
bool mounted = false;
const char* table = "/etc/mtab";
- struct mntent* mnt = null;
+ struct mntent mnt;
+ char buf[256];
fp = setmntent(table, "r");
SysTryCatch(NID_SYS, fp != null, r = E_SYSTEM, r, "It is failed to open mount table.");
SysLog(NID_SYS, "path: %s", path);
- while(mnt=getmntent(fp))
+ while(getmntent_r(fp, &mnt, buf, sizeof(buf)))
{
- SysLog(NID_SYS, "mnt_dir: %s", mnt->mnt_dir);
- if(strcmp(mnt->mnt_dir, path) == 0)
+ SysLog(NID_SYS, "mnt_dir: %s", mnt.mnt_dir);
+ if(strcmp(mnt.mnt_dir, path) == 0)
{
mounted = true;
break;