* syscalls.cc (_open): Set name in fhandler object after successful

creation.
        (stat_dev): Set device type to block device in FH_FLOPPY case.
This commit is contained in:
Corinna Vinschen 2001-09-23 15:35:02 +00:00
parent e3fbb5f5ce
commit 4367ec036f
2 changed files with 17 additions and 7 deletions

View File

@ -1,3 +1,9 @@
Sun Sep 23 16:55:00 2001 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (_open): Set name in fhandler object after successful
creation.
(stat_dev): Set device type to block device in FH_FLOPPY case.
Sun Sep 23 11:15:00 2001 Corinna Vinschen <corinna@vinschen.de>
* dtable.cc (dtable::build_fhandler): Initialize unit when using

View File

@ -487,15 +487,19 @@ _open (const char *unix_path, int flags, ...)
else
{
path_conv pc;
if ((fh = cygheap->fdtab.build_fhandler (fd, unix_path, NULL, &pc)) == NULL)
if (!(fh = cygheap->fdtab.build_fhandler (fd, unix_path, NULL, &pc)))
res = -1; // errno already set
else if (!fh->open (pc, flags, (mode & 07777) & ~cygheap->umask))
else
{
cygheap->fdtab.release (fd);
res = -1;
fh->set_name (unix_path, pc.get_win32 ());
if (!fh->open (pc, flags, (mode & 07777) & ~cygheap->umask))
{
cygheap->fdtab.release (fd);
res = -1;
}
else if ((res = fd) <= 2)
set_std_handle (res);
}
else if ((res = fd) <= 2)
set_std_handle (res);
}
ReleaseResourceLock (LOCK_FD_LIST,WRITE_LOCK|READ_LOCK," open");
}
@ -1043,7 +1047,7 @@ stat_dev (DWORD devn, int unit, unsigned long ino, struct stat *buf)
break;
}
buf->st_mode |= S_IFCHR;
buf->st_mode |= devn == FH_FLOPPY ? S_IFBLK : S_IFCHR;
buf->st_blksize = S_BLKSIZE;
buf->st_nlink = 1;
buf->st_dev = buf->st_rdev = FHDEVN (devn) << 8 | (unit & 0xff);