mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* file.c, ext/etc/etc.c, ext/socket/unixsocket.c,
ext/openssl/ossl.h, ext/openssl/openssl_missing.c: Use HAVE_AGGREGATE_MEMBER instead of HAVE_ST_MEMBER. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
adb575e21e
commit
bfb334eefa
6 changed files with 39 additions and 33 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Thu May 9 21:09:57 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* file.c, ext/etc/etc.c, ext/socket/unixsocket.c,
|
||||||
|
ext/openssl/ossl.h, ext/openssl/openssl_missing.c: Use
|
||||||
|
HAVE_AGGREGATE_MEMBER instead of HAVE_ST_MEMBER.
|
||||||
|
|
||||||
Thu May 9 20:43:41 2013 Tanaka Akira <akr@fsij.org>
|
Thu May 9 20:43:41 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/ancdata.c (bsock_sendmsg_internal): Always set
|
* ext/socket/ancdata.c (bsock_sendmsg_internal): Always set
|
||||||
|
|
|
@ -89,32 +89,32 @@ setup_passwd(struct passwd *pwd)
|
||||||
if (pwd == 0) rb_sys_fail("/etc/passwd");
|
if (pwd == 0) rb_sys_fail("/etc/passwd");
|
||||||
return rb_struct_new(sPasswd,
|
return rb_struct_new(sPasswd,
|
||||||
safe_setup_str(pwd->pw_name),
|
safe_setup_str(pwd->pw_name),
|
||||||
#ifdef HAVE_ST_PW_PASSWD
|
#ifdef HAVE_STRUCT_PASSWD_PW_PASSWD
|
||||||
safe_setup_str(pwd->pw_passwd),
|
safe_setup_str(pwd->pw_passwd),
|
||||||
#endif
|
#endif
|
||||||
UIDT2NUM(pwd->pw_uid),
|
UIDT2NUM(pwd->pw_uid),
|
||||||
GIDT2NUM(pwd->pw_gid),
|
GIDT2NUM(pwd->pw_gid),
|
||||||
#ifdef HAVE_ST_PW_GECOS
|
#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
|
||||||
safe_setup_str(pwd->pw_gecos),
|
safe_setup_str(pwd->pw_gecos),
|
||||||
#endif
|
#endif
|
||||||
safe_setup_str(pwd->pw_dir),
|
safe_setup_str(pwd->pw_dir),
|
||||||
safe_setup_str(pwd->pw_shell),
|
safe_setup_str(pwd->pw_shell),
|
||||||
#ifdef HAVE_ST_PW_CHANGE
|
#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE
|
||||||
INT2NUM(pwd->pw_change),
|
INT2NUM(pwd->pw_change),
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ST_PW_QUOTA
|
#ifdef HAVE_STRUCT_PASSWD_PW_QUOTA
|
||||||
INT2NUM(pwd->pw_quota),
|
INT2NUM(pwd->pw_quota),
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ST_PW_AGE
|
#ifdef HAVE_STRUCT_PASSWD_PW_AGE
|
||||||
PW_AGE2VAL(pwd->pw_age),
|
PW_AGE2VAL(pwd->pw_age),
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ST_PW_CLASS
|
#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
|
||||||
safe_setup_str(pwd->pw_class),
|
safe_setup_str(pwd->pw_class),
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ST_PW_COMMENT
|
#ifdef HAVE_STRUCT_PASSWD_PW_COMMENT
|
||||||
safe_setup_str(pwd->pw_comment),
|
safe_setup_str(pwd->pw_comment),
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ST_PW_EXPIRE
|
#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE
|
||||||
INT2NUM(pwd->pw_expire),
|
INT2NUM(pwd->pw_expire),
|
||||||
#endif
|
#endif
|
||||||
0 /*dummy*/
|
0 /*dummy*/
|
||||||
|
@ -359,7 +359,7 @@ setup_group(struct group *grp)
|
||||||
}
|
}
|
||||||
return rb_struct_new(sGroup,
|
return rb_struct_new(sGroup,
|
||||||
safe_setup_str(grp->gr_name),
|
safe_setup_str(grp->gr_name),
|
||||||
#ifdef HAVE_ST_GR_PASSWD
|
#ifdef HAVE_STRUCT_GROUP_GR_PASSWD
|
||||||
safe_setup_str(grp->gr_passwd),
|
safe_setup_str(grp->gr_passwd),
|
||||||
#endif
|
#endif
|
||||||
GIDT2NUM(grp->gr_gid),
|
GIDT2NUM(grp->gr_gid),
|
||||||
|
@ -680,26 +680,26 @@ Init_etc(void)
|
||||||
|
|
||||||
sPasswd = rb_struct_define(NULL,
|
sPasswd = rb_struct_define(NULL,
|
||||||
"name", "passwd", "uid", "gid",
|
"name", "passwd", "uid", "gid",
|
||||||
#ifdef HAVE_ST_PW_GECOS
|
#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
|
||||||
"gecos",
|
"gecos",
|
||||||
#endif
|
#endif
|
||||||
"dir", "shell",
|
"dir", "shell",
|
||||||
#ifdef HAVE_ST_PW_CHANGE
|
#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE
|
||||||
"change",
|
"change",
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ST_PW_QUOTA
|
#ifdef HAVE_STRUCT_PASSWD_PW_QUOTA
|
||||||
"quota",
|
"quota",
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ST_PW_AGE
|
#ifdef HAVE_STRUCT_PASSWD_PW_AGE
|
||||||
"age",
|
"age",
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ST_PW_CLASS
|
#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
|
||||||
"uclass",
|
"uclass",
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ST_PW_COMMENT
|
#ifdef HAVE_STRUCT_PASSWD_PW_COMMENT
|
||||||
"comment",
|
"comment",
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_ST_PW_EXPIRE
|
#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE
|
||||||
"expire",
|
"expire",
|
||||||
#endif
|
#endif
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -728,19 +728,19 @@ Init_etc(void)
|
||||||
* contains a longer String description of the user, such as
|
* contains a longer String description of the user, such as
|
||||||
* a full name. Some Unix systems provide structured information in the
|
* a full name. Some Unix systems provide structured information in the
|
||||||
* gecos field, but this is system-dependent.
|
* gecos field, but this is system-dependent.
|
||||||
* must be compiled with +HAVE_ST_PW_GECOS+
|
* must be compiled with +HAVE_STRUCT_PASSWD_PW_GECOS+
|
||||||
* change::
|
* change::
|
||||||
* password change time(integer) must be compiled with +HAVE_ST_PW_CHANGE+
|
* password change time(integer) must be compiled with +HAVE_STRUCT_PASSWD_PW_CHANGE+
|
||||||
* quota::
|
* quota::
|
||||||
* quota value(integer) must be compiled with +HAVE_ST_PW_QUOTA+
|
* quota value(integer) must be compiled with +HAVE_STRUCT_PASSWD_PW_QUOTA+
|
||||||
* age::
|
* age::
|
||||||
* password age(integer) must be compiled with +HAVE_ST_PW_AGE+
|
* password age(integer) must be compiled with +HAVE_STRUCT_PASSWD_PW_AGE+
|
||||||
* class::
|
* class::
|
||||||
* user access class(string) must be compiled with +HAVE_ST_PW_CLASS+
|
* user access class(string) must be compiled with +HAVE_STRUCT_PASSWD_PW_CLASS+
|
||||||
* comment::
|
* comment::
|
||||||
* comment(string) must be compiled with +HAVE_ST_PW_COMMENT+
|
* comment(string) must be compiled with +HAVE_STRUCT_PASSWD_PW_COMMENT+
|
||||||
* expire::
|
* expire::
|
||||||
* account expiration time(integer) must be compiled with +HAVE_ST_PW_EXPIRE+
|
* account expiration time(integer) must be compiled with +HAVE_STRUCT_PASSWD_PW_EXPIRE+
|
||||||
*/
|
*/
|
||||||
rb_define_const(mEtc, "Passwd", sPasswd);
|
rb_define_const(mEtc, "Passwd", sPasswd);
|
||||||
rb_set_class_path(sPasswd, mEtc, "Passwd");
|
rb_set_class_path(sPasswd, mEtc, "Passwd");
|
||||||
|
@ -750,7 +750,7 @@ Init_etc(void)
|
||||||
|
|
||||||
#ifdef HAVE_GETGRENT
|
#ifdef HAVE_GETGRENT
|
||||||
sGroup = rb_struct_define(NULL, "name",
|
sGroup = rb_struct_define(NULL, "name",
|
||||||
#ifdef HAVE_ST_GR_PASSWD
|
#ifdef HAVE_STRUCT_GROUP_GR_PASSWD
|
||||||
"passwd",
|
"passwd",
|
||||||
#endif
|
#endif
|
||||||
"gid", "mem", NULL);
|
"gid", "mem", NULL);
|
||||||
|
@ -769,7 +769,7 @@ Init_etc(void)
|
||||||
* string is returned if no password is needed to obtain membership of
|
* string is returned if no password is needed to obtain membership of
|
||||||
* the group.
|
* the group.
|
||||||
*
|
*
|
||||||
* Must be compiled with +HAVE_ST_GR_PASSWD+.
|
* Must be compiled with +HAVE_STRUCT_GROUP_GR_PASSWD+.
|
||||||
* gid::
|
* gid::
|
||||||
* contains the group's numeric ID as an integer.
|
* contains the group's numeric ID as an integer.
|
||||||
* mem::
|
* mem::
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
*/
|
*/
|
||||||
#include RUBY_EXTCONF_H
|
#include RUBY_EXTCONF_H
|
||||||
|
|
||||||
#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ST_ENGINE)
|
#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_EVP_CIPHER_CTX_ENGINE)
|
||||||
# include <openssl/engine.h>
|
# include <openssl/engine.h>
|
||||||
#endif
|
#endif
|
||||||
#include <openssl/x509_vfy.h>
|
#include <openssl/x509_vfy.h>
|
||||||
|
@ -122,7 +122,7 @@ EVP_CIPHER_CTX_copy(EVP_CIPHER_CTX *out, EVP_CIPHER_CTX *in)
|
||||||
{
|
{
|
||||||
memcpy(out, in, sizeof(EVP_CIPHER_CTX));
|
memcpy(out, in, sizeof(EVP_CIPHER_CTX));
|
||||||
|
|
||||||
#if defined(HAVE_ENGINE_ADD) && defined(HAVE_ST_ENGINE)
|
#if defined(HAVE_ENGINE_ADD) && defined(HAVE_EVP_CIPHER_CTX_ENGINE)
|
||||||
if (in->engine) ENGINE_add(out->engine);
|
if (in->engine) ENGINE_add(out->engine);
|
||||||
if (in->cipher_data) {
|
if (in->cipher_data) {
|
||||||
out->cipher_data = OPENSSL_malloc(in->cipher->ctx_size);
|
out->cipher_data = OPENSSL_malloc(in->cipher->ctx_size);
|
||||||
|
|
|
@ -66,7 +66,7 @@ extern "C" {
|
||||||
#include <openssl/conf_api.h>
|
#include <openssl/conf_api.h>
|
||||||
#undef X509_NAME
|
#undef X509_NAME
|
||||||
#undef PKCS7_SIGNER_INFO
|
#undef PKCS7_SIGNER_INFO
|
||||||
#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_ST_ENGINE)
|
#if defined(HAVE_OPENSSL_ENGINE_H) && defined(HAVE_EVP_CIPHER_CTX_ENGINE)
|
||||||
# define OSSL_ENGINE_ENABLED
|
# define OSSL_ENGINE_ENABLED
|
||||||
# include <openssl/engine.h>
|
# include <openssl/engine.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -163,7 +163,7 @@ unix_recvfrom(int argc, VALUE *argv, VALUE sock)
|
||||||
#define FD_PASSING_BY_MSG_CONTROL 0
|
#define FD_PASSING_BY_MSG_CONTROL 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_ST_MSG_ACCRIGHTS)
|
#if defined(HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS)
|
||||||
#define FD_PASSING_BY_MSG_ACCRIGHTS 1
|
#define FD_PASSING_BY_MSG_ACCRIGHTS 1
|
||||||
#else
|
#else
|
||||||
#define FD_PASSING_BY_MSG_ACCRIGHTS 0
|
#define FD_PASSING_BY_MSG_ACCRIGHTS 0
|
||||||
|
|
8
file.c
8
file.c
|
@ -531,7 +531,7 @@ rb_stat_gid(VALUE self)
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_stat_rdev(VALUE self)
|
rb_stat_rdev(VALUE self)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ST_RDEV
|
#ifdef HAVE_STRUCT_STAT_ST_RDEV
|
||||||
return DEVT2NUM(get_stat(self)->st_rdev);
|
return DEVT2NUM(get_stat(self)->st_rdev);
|
||||||
#else
|
#else
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
@ -552,7 +552,7 @@ rb_stat_rdev(VALUE self)
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_stat_rdev_major(VALUE self)
|
rb_stat_rdev_major(VALUE self)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_ST_RDEV) && defined(major)
|
#if defined(HAVE_STRUCT_STAT_ST_RDEV) && defined(major)
|
||||||
return DEVT2NUM(major(get_stat(self)->st_rdev));
|
return DEVT2NUM(major(get_stat(self)->st_rdev));
|
||||||
#else
|
#else
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
@ -573,7 +573,7 @@ rb_stat_rdev_major(VALUE self)
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_stat_rdev_minor(VALUE self)
|
rb_stat_rdev_minor(VALUE self)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_ST_RDEV) && defined(minor)
|
#if defined(HAVE_STRUCT_STAT_ST_RDEV) && defined(minor)
|
||||||
return DEVT2NUM(minor(get_stat(self)->st_rdev));
|
return DEVT2NUM(minor(get_stat(self)->st_rdev));
|
||||||
#else
|
#else
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
@ -609,7 +609,7 @@ rb_stat_size(VALUE self)
|
||||||
static VALUE
|
static VALUE
|
||||||
rb_stat_blksize(VALUE self)
|
rb_stat_blksize(VALUE self)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_ST_BLKSIZE
|
#ifdef HAVE_STRUCT_STAT_ST_BLKSIZE
|
||||||
return ULONG2NUM(get_stat(self)->st_blksize);
|
return ULONG2NUM(get_stat(self)->st_blksize);
|
||||||
#else
|
#else
|
||||||
return Qnil;
|
return Qnil;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue