diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-10 03:57:23 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-02-10 03:57:23 +0000 |
commit | 160c230f94919299b1270e90b961c04fc06cc255 (patch) | |
tree | 272e169e0f731b0a70466e751d866f69f21afee0 | |
parent | 395abae93d6c9d86364714b4cbf4c3cad9d020ef (diff) | |
download | ruby-160c230f94919299b1270e90b961c04fc06cc255.tar.gz |
* ext/socket/option.c (inspect_local_peercred): constfied.
* ext/socket/ancdata.c (anc_inspect_socket_creds): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ext/socket/ancdata.c | 7 | ||||
-rw-r--r-- | ext/socket/option.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c index 468693f078..71c4dd8a9c 100644 --- a/ext/socket/ancdata.c +++ b/ext/socket/ancdata.c @@ -433,7 +433,6 @@ anc_inspect_passcred_credentials(int level, int type, VALUE data, VALUE ret) static int anc_inspect_socket_creds(int level, int type, VALUE data, VALUE ret) { - int i; if (level != SOL_SOCKET && type != SCM_CREDS) return -1; @@ -457,7 +456,8 @@ anc_inspect_socket_creds(int level, int type, VALUE data, VALUE ret) rb_str_catf(ret, " euid=%u", cred.cmcred_euid); rb_str_catf(ret, " gid=%u", cred.cmcred_gid); if (cred.cmcred_ngroups) { - char *sep = "="; + int i; + const char *sep = "="; rb_str_cat2(ret, " groups"); for (i = 0; i < cred.cmcred_ngroups; i++) { rb_str_catf(ret, "%s%u", sep, cred.cmcred_groups[i]); @@ -480,7 +480,8 @@ anc_inspect_socket_creds(int level, int type, VALUE data, VALUE ret) rb_str_catf(ret, " gid=%u", cred->sc_gid); rb_str_catf(ret, " egid=%u", cred->sc_egid); if (cred0.sc_ngroups) { - char *sep = "="; + int i; + const char *sep = "="; rb_str_cat2(ret, " groups"); for (i = 0; i < cred0.sc_ngroups; i++) { rb_str_catf(ret, "%s%u", sep, cred->sc_groups[i]); diff --git a/ext/socket/option.c b/ext/socket/option.c index eeb292dc76..01a371639c 100644 --- a/ext/socket/option.c +++ b/ext/socket/option.c @@ -272,7 +272,7 @@ inspect_local_peercred(int level, int optname, VALUE data, VALUE ret) rb_str_catf(ret, " euid=%u", cred.cr_uid); if (cred.cr_ngroups) { int i; - char *sep = " groups="; + const char *sep = " groups="; for (i = 0; i < cred.cr_ngroups; i++) { rb_str_catf(ret, "%s%u", sep, cred.cr_groups[i]); sep = ","; |