mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-io: remove unused flock function
The local flock() function for Windows is now dead code since the HAL refactoring. The Windows implementation is in hal-win-io which provides mrb_hal_io_flock(). Fixes warning: 'flock' defined but not used [-Wunused-function] Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -100,20 +100,6 @@
|
||||
# define mrb_fstat(fd, sb) _fstat64(fd, sb)
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
static int
|
||||
flock(int fd, int operation)
|
||||
{
|
||||
HANDLE h = (HANDLE)_get_osfhandle(fd);
|
||||
DWORD flags;
|
||||
flags = ((operation & LOCK_NB) ? LOCKFILE_FAIL_IMMEDIATELY : 0)
|
||||
| ((operation & LOCK_SH) ? LOCKFILE_EXCLUSIVE_LOCK : 0);
|
||||
static const OVERLAPPED zero_ov = {0};
|
||||
OVERLAPPED ov = zero_ov;
|
||||
return LockFileEx(h, flags, 0, 0xffffffff, 0xffffffff, &ov) ? 0 : -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* call-seq:
|
||||
* File.umask([mask]) -> integer
|
||||
|
||||
Reference in New Issue
Block a user