summaryrefslogtreecommitdiff
path: root/ext/etc
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-19 12:32:14 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-19 12:32:14 (GMT)
commit21190be21cef311e095488ee3193144ca86850cc (patch)
treee18f723f96acd497d6523b06bbec1bddcda733dc /ext/etc
parent3aacf8850001fa910edbefd48c7550daa1edcfe5 (diff)
etc.c: fix parameter
* ext/etc/etc.c (etc_uname): call with same first parameters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/etc')
-rw-r--r--ext/etc/etc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 4b1ce35..944b722 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -702,9 +702,10 @@ etc_uname(VALUE obj)
rb_w32_conv_from_wchar(v.szCSDVersion, rb_utf8_encoding()));
rb_hash_aset(result, ID2SYM(rb_intern("version")), version);
- GetComputerNameExW(ComputerNameDnsFullyQualified, NULL, &len);
+# define GET_COMPUTER_NAME(ptr, plen) GetComputerNameExW(ComputerNameDnsFullyQualified, ptr, len);
+ GET_COMPUTER_NAME(NULL, &len);
buf = ALLOCV_N(WCHAR, vbuf, len);
- if (GetComputerNameExW(ComputerNameDnsHostname, buf, &len)) {
+ if (GET_COMPUTER_NAME(buf, &len)) {
nodename = rb_w32_conv_from_wchar(buf, rb_utf8_encoding());
}
ALLOCV_END(vbuf);