diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-22 10:39:48 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-05-22 10:39:48 +0000 |
commit | 210f863906c34ad524007abb3b045d4b3cba98b1 (patch) | |
tree | 5b8a152a0dc10635d17f62eb5cae727320b12b2b /win32 | |
parent | fa244db49b16d05c0042e01ef8faa9190acc5922 (diff) |
revert File::Statfs [Feature #9772]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r-- | win32/Makefile.sub | 2 | ||||
-rw-r--r-- | win32/win32.c | 49 |
2 files changed, 0 insertions, 51 deletions
diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 073b9d6544..eb4241df32 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -700,8 +700,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub #define SETPGRP_VOID 1 #define RSHIFT(x,y) ((x)>>(int)y) #define HAVE_RB_FD_INIT 1 -#define HAVE_STRUCT_STATFS 1 -#define HAVE_STRUCT_STATFS_F_FSTYPENAME 1 #define RUBY_SETJMP(env) _setjmp(env) #define RUBY_LONGJMP(env,val) longjmp(env,val) #define RUBY_JMP_BUF jmp_buf diff --git a/win32/win32.c b/win32/win32.c index 4ebf5c8e76..f58425f1b9 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -5865,55 +5865,6 @@ rb_w32_pipe(int fds[2]) } /* License: Ruby's */ -int -ustatfs(const char *path, struct statfs *buf) -{ - WCHAR *wpath = utf8_to_wstr(path, NULL); - WCHAR root[MAX_PATH], system[8]; - DWORD serial, spc, bps, unused, total; - char *tmp; - WINBASEAPI BOOL WINAPI GetVolumePathNameW(LPCWSTR, LPWSTR, DWORD); - - if (!wpath) { - return -1; - } - - if (!GetVolumePathNameW(wpath, root, sizeof(root) / sizeof(WCHAR))) { - free(wpath); - errno = map_errno(GetLastError()); - return -1; - } - free(wpath); - - if (!GetVolumeInformationW(root, NULL, 0, &serial, NULL, NULL, - system, sizeof(system) / sizeof(WCHAR))) { - errno = map_errno(GetLastError()); - return -1; - } - - if (!GetDiskFreeSpaceW(root, &spc, &bps, &unused, &total)) { - errno = map_errno(GetLastError()); - return -1; - } - - tmp = wstr_to_filecp(system, NULL); - if (!tmp) { - return -1; - } - strlcpy(buf->f_fstypename, tmp, sizeof(buf->f_fstypename)); - free(tmp); - - buf->f_type = 0; - buf->f_bsize = (uint64_t)spc * bps; - buf->f_blocks = total; - buf->f_bfree = buf->f_bavail = unused; - buf->f_files = buf->f_ffree = 0; - buf->f_fsid = serial; - - return 0; -} - -/* License: Ruby's */ static int console_emulator_p(void) { |