diff --git a/ChangeLog b/ChangeLog index 61520c983a..4eba9e7269 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sun Apr 19 01:39:17 2009 Tanaka Akira + + * process.c (proc_seteuid_m): defined to use rb_f_notimplement if not + implemented. + (proc_setegid_m): ditto. + Sun Apr 19 01:03:56 2009 Tanaka Akira * process.c (proc_setuid): use rb_f_notimplement if not implemented. diff --git a/process.c b/process.c index 81fff15f81..5669cf6641 100644 --- a/process.c +++ b/process.c @@ -4805,6 +4805,12 @@ proc_seteuid(VALUE obj, VALUE euid) return euid; } +#if defined(HAVE_SETRESUID) || defined(HAVE_SETREUID) || defined(HAVE_SETEUID) || defined(HAVE_SETUID) +#define proc_seteuid_m proc_seteuid +#else +#define proc_seteuid_m rb_f_notimplement +#endif + static rb_uid_t rb_seteuid_core(rb_uid_t euid) { @@ -4918,6 +4924,12 @@ proc_setegid(VALUE obj, VALUE egid) return egid; } +#if defined(HAVE_SETRESGID) || defined(HAVE_SETREGID) || defined(HAVE_SETEGID) || defined(HAVE_SETGID) +#define proc_setegid_m proc_setegid +#else +#define proc_setegid_m rb_f_notimplement +#endif + static rb_gid_t rb_setegid_core(rb_gid_t egid) { @@ -5502,9 +5514,9 @@ Init_process(void) rb_define_module_function(rb_mProcess, "gid", proc_getgid, 0); rb_define_module_function(rb_mProcess, "gid=", proc_setgid, 1); rb_define_module_function(rb_mProcess, "euid", proc_geteuid, 0); - rb_define_module_function(rb_mProcess, "euid=", proc_seteuid, 1); + rb_define_module_function(rb_mProcess, "euid=", proc_seteuid_m, 1); rb_define_module_function(rb_mProcess, "egid", proc_getegid, 0); - rb_define_module_function(rb_mProcess, "egid=", proc_setegid, 1); + rb_define_module_function(rb_mProcess, "egid=", proc_setegid_m, 1); rb_define_module_function(rb_mProcess, "initgroups", proc_initgroups, 2); rb_define_module_function(rb_mProcess, "groups", proc_getgroups, 0); rb_define_module_function(rb_mProcess, "groups=", proc_setgroups, 1);