Skip to content

Commit

Permalink
Merge pull request #9 from dscho/tempfs
Browse files Browse the repository at this point in the history
Introduce the 'usertemp' filesystem type
  • Loading branch information
dscho committed May 25, 2015
2 parents 510cd1c + 15f40f6 commit 833e388
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions winsup/cygwin/mount.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,8 @@ mount_info::from_fstab_line (char *line, bool user)
unsigned mount_flags = MOUNT_SYSTEM | MOUNT_BINARY;
if (!strcmp (fs_type, "cygdrive"))
mount_flags |= MOUNT_NOPOSIX;
if (!strcmp (fs_type, "usertemp"))
mount_flags |= MOUNT_IMMUTABLE;
if (!fstab_read_flags (&c, mount_flags, false))
return true;
if (mount_flags & MOUNT_BIND)
Expand All @@ -1172,6 +1174,17 @@ mount_info::from_fstab_line (char *line, bool user)
slashify (posix_path, cygdrive, 1);
cygdrive_len = strlen (cygdrive);
}
else if (!strcmp (fs_type, "usertemp"))
{
char tmp[MAX_PATH];
GetEnvironmentVariable ("TMP", tmp, sizeof(tmp));
if (*tmp)
{
int res = mount_table->add_item (tmp, posix_path, mount_flags);
if (res && get_errno () == EMFILE)
return false;
}
}
else
{
int res = mount_table->add_item (native_path, posix_path, mount_flags);
Expand Down

0 comments on commit 833e388

Please sign in to comment.