diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-04-10 19:24:55 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-04-10 19:24:55 +0000 |
commit | 7224437c6270910a02646147149aaa97de145217 (patch) | |
tree | 9760e4e810a3c7828e42e92d950331dfeec8da4b /winsup/cygwin/syscalls.cc | |
parent | 56551a9bfbb369e29b12d1b60dc810cd5a3356b9 (diff) | |
download | cygnal-7224437c6270910a02646147149aaa97de145217.tar.gz cygnal-7224437c6270910a02646147149aaa97de145217.tar.bz2 cygnal-7224437c6270910a02646147149aaa97de145217.zip |
* fhandler.cc (rootdir): Add and use second argument.
* winsup.h (rootdir): Add second argument in declaration.
* path.cc (fs_info::update): Modify call to rootdir.
* syscalls.cc (check_posix_perm): Ditto.
(statfs): Ditto. Move syscall_printf near top.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r-- | winsup/cygwin/syscalls.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index ad99d8ab0..bac1ccb72 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1457,7 +1457,7 @@ check_posix_perm (const char *fname, int v) if (!allow_ntsec) return 0; - char *root = rootdir (strcpy ((char *)alloca (strlen (fname)), fname)); + char *root = rootdir (fname, (char *)alloca (strlen (fname))); if (!allow_smbntsec && ((root[0] == '\\' && root[1] == '\\') @@ -1793,7 +1793,9 @@ get_osfhandle (int fd) extern "C" int statfs (const char *fname, struct statfs *sfs) { - char root_dir[CYG_MAX_PATH]; + char root[CYG_MAX_PATH]; + + syscall_printf ("statfs %s", fname); if (!sfs) { @@ -1802,10 +1804,8 @@ statfs (const char *fname, struct statfs *sfs) } path_conv full_path (fname, PC_SYM_FOLLOW | PC_FULL); - strncpy (root_dir, full_path, CYG_MAX_PATH); - const char *root = rootdir (root_dir); - - syscall_printf ("statfs %s", root); + if (!rootdir (full_path, root)) + return -1; /* GetDiskFreeSpaceEx must be called before GetDiskFreeSpace on WinME, to avoid the MS KB 314417 bug */ |