From 97ba0d4aa788273c4d4b4432a51683597c32c2cc Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 9 Feb 2009 16:03:08 +0000 Subject: [PATCH] * ext/socket/mkconstants.rb: generate intern_family_noprefix. * ext/socket/option.c (sockopt_inspect): use intern_family_noprefix not to show AF_ prefix. * ext/socket/ancdata.c (ancillary_inspect): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22187 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 9 +++++++++ ext/socket/ancdata.c | 2 +- ext/socket/mkconstants.rb | 1 + ext/socket/option.c | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7aacb160bd..2022705f55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +Tue Feb 10 01:02:16 2009 Tanaka Akira + + * ext/socket/mkconstants.rb: generate intern_family_noprefix. + + * ext/socket/option.c (sockopt_inspect): use intern_family_noprefix + not to show AF_ prefix. + + * ext/socket/ancdata.c (ancillary_inspect): ditto. + Mon Feb 9 23:21:29 2009 Tanaka Akira * ext/socket/constants.c (level_arg): use unknown_level_to_int for diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index 27b15b25fc..c8535148e4 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -599,7 +599,7 @@ ancillary_inspect(VALUE self) ret = rb_sprintf("#<%s: ", rb_obj_classname(self)); - family_id = intern_family(family); + family_id = intern_family_noprefix(family); if (family_id) rb_str_cat2(ret, rb_id2name(family_id)); else diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb index d3058f11f0..3b8e24603f 100644 --- a/ext/socket/mkconstants.rb +++ b/ext/socket/mkconstants.rb @@ -253,6 +253,7 @@ def_name_to_int("shutdown_how_to_int", /\ASHUT_/, "SHUT_") def_name_to_int("scm_optname_to_int", /\ASCM_/, "SCM_") def_intern('intern_family', /\AAF_/) +def_intern('intern_family_noprefix', /\AAF_/, "AF_") def_intern('intern_protocol_family', /\APF_/) def_intern('intern_socktype', /\ASOCK_/) def_intern('intern_ipproto', /\AIPPROTO_/) diff --git a/ext/socket/option.c b/ext/socket/option.c index c0e28b7c3a..45559b6c00 100644 --- a/ext/socket/option.c +++ b/ext/socket/option.c @@ -302,7 +302,7 @@ sockopt_inspect(VALUE self) ret = rb_sprintf("#<%s: ", rb_obj_classname(self)); - family_id = intern_family(family); + family_id = intern_family_noprefix(family); if (family_id) rb_str_cat2(ret, rb_id2name(family_id)); else