ruby-changes:39606
From: nobu <ko1@a...>
Date: Wed, 26 Aug 2015 14:21:58 +0900 (JST)
Subject: [ruby-changes:39606] nobu:r51687 (trunk): win32.c: fake lchown
nobu 2015-08-26 14:21:41 +0900 (Wed, 26 Aug 2015) New Revision: 51687 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51687 Log: win32.c: fake lchown * win32/win32.c (lchown, rb_w32_ulchown): fake lchown. Modified files: trunk/configure.in trunk/cygwin/GNUmakefile.in trunk/file.c trunk/win32/Makefile.sub trunk/win32/file.h trunk/win32/win32.c Index: configure.in =================================================================== --- configure.in (revision 51686) +++ configure.in (revision 51687) @@ -1106,6 +1106,7 @@ main() https://github.com/ruby/ruby/blob/trunk/configure.in#L1106 ac_cv_func_isinf=yes ac_cv_func_isnan=yes ac_cv_func_finite=yes + ac_cv_func_lchown=yes ac_cv_func_link=yes ac_cv_func_readlink=yes ac_cv_func_symlink=yes Index: cygwin/GNUmakefile.in =================================================================== --- cygwin/GNUmakefile.in (revision 51686) +++ cygwin/GNUmakefile.in (revision 51687) @@ -87,6 +87,7 @@ ifeq (@target_os@,mingw32) https://github.com/ruby/ruby/blob/trunk/cygwin/GNUmakefile.in#L87 $(OBJS) $(MAINOBJ): win32.h dir.$(OBJEXT) win32/win32.$(OBJEXT): win32/dir.h +file.$(OBJEXT) win32/win32.$(OBJEXT): win32/file.h endif $(LIBRUBY_SO): $(RUBYDEF) Index: win32/win32.c =================================================================== --- win32/win32.c (revision 51686) +++ win32/win32.c (revision 51687) @@ -4482,6 +4482,18 @@ rb_w32_uchown(const char *path, int owne https://github.com/ruby/ruby/blob/trunk/win32/win32.c#L4482 return 0; } +int +lchown(const char *path, int owner, int group) +{ + return 0; +} + +int +rb_w32_ulchown(const char *path, int owner, int group) +{ + return 0; +} + /* License: Ruby's */ int kill(int pid, int sig) Index: win32/Makefile.sub =================================================================== --- win32/Makefile.sub (revision 51686) +++ win32/Makefile.sub (revision 51687) @@ -720,6 +720,7 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/ https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L720 #define HAVE_LINK 1 #define HAVE_READLINK 1 #define HAVE_SYMLINK 1 +#define HAVE_LCHOWN 1 #define HAVE__SETJMP 1 #define HAVE_TELLDIR 1 #define HAVE_SEEKDIR 1 @@ -1138,6 +1139,7 @@ enc/jis/props.h: {$(srcdir)}enc/jis/prop https://github.com/ruby/ruby/blob/trunk/win32/Makefile.sub#L1139 $(OBJS): {$(hdrdir)/ruby}win32.h dir.$(OBJEXT) win32/win32.$(OBJEXT): {$(srcdir)}win32/dir.h +file.$(OBJEXT) win32/win32.$(OBJEXT): {$(VPATH)}win32/file.h ext/extinit.obj: ext/extinit.c $(SETUP) $(ECHO) compiling ext/extinit.c Index: win32/file.h =================================================================== --- win32/file.h (revision 51686) +++ win32/file.h (revision 51687) @@ -37,4 +37,7 @@ typedef struct { https://github.com/ruby/ruby/blob/trunk/win32/file.h#L37 int rb_w32_read_reparse_point(const WCHAR *path, rb_w32_reparse_buffer_t *rp, size_t bufsize, WCHAR **result, DWORD *len); +int lchown(const char *path, int owner, int group); +int rb_w32_ulchown(const char *path, int owner, int group); + #endif /* RUBY_WIN32_FILE_H */ Index: file.c =================================================================== --- file.c (revision 51686) +++ file.c (revision 51687) @@ -94,6 +94,7 @@ int flock(int, int); https://github.com/ruby/ruby/blob/trunk/file.c#L94 /* define system APIs */ #ifdef _WIN32 +#include "win32/file.h" #define STAT(p, s) rb_w32_ustati64((p), (s)) #undef lstat #define lstat(p, s) rb_w32_ulstati64((p), (s)) @@ -103,6 +104,8 @@ int flock(int, int); https://github.com/ruby/ruby/blob/trunk/file.c#L104 #define chmod(p, m) rb_w32_uchmod((p), (m)) #undef chown #define chown(p, o, g) rb_w32_uchown((p), (o), (g)) +#undef lchown +#define lchown(p, o, g) rb_w32_ulchown((p), (o), (g)) #undef utime #define utime(p, t) rb_w32_uutime((p), (t)) #undef link -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/