summaryrefslogtreecommitdiff
path: root/ruby
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2010-04-12 22:40:20 -0700
committerRuss Allbery <rra@stanford.edu>2010-04-12 22:40:20 -0700
commit7423a4cd75a0f764f2233b15f7e89248b679a607 (patch)
treea306e9a25d9195160b025c82b964ee4ee00cdaab /ruby
parent2ccbe09049f4c99faf3531b9febb7fa2061c0e13 (diff)
Ruby: don't convert the remctl error to an object when throwing
The syntax we're using to add a string to the thrown Remctl::Error expects a regular C string, not a Ruby object, so don't convert the results of remctl_error() to a Ruby object before passing it into rb_raise.
Diffstat (limited to 'ruby')
-rw-r--r--ruby/remctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ruby/remctl.c b/ruby/remctl.c
index 71b308c..be4456f 100644
--- a/ruby/remctl.c
+++ b/ruby/remctl.c
@@ -294,7 +294,7 @@ rb_remctl_reopen(VALUE self)
/* Reopen the connection. */
if (!remctl_open(r, host, port, princ))
- rb_raise(eRemctlError, "%s", rb_str_new2(remctl_error(r)));
+ rb_raise(eRemctlError, "%s", remctl_error(r));
DATA_PTR(self) = r;
return self;
}
@@ -324,7 +324,7 @@ rb_remctl_command(int argc, VALUE argv[], VALUE self)
iov[i].iov_len = RSTRING_LEN(s);
}
if (!remctl_commandv(r, iov, argc))
- rb_raise(eRemctlError, "%s", rb_str_new2(remctl_error(r)));
+ rb_raise(eRemctlError, "%s", remctl_error(r));
return Qnil;
}
@@ -360,7 +360,7 @@ rb_remctl_output(VALUE self)
GET_REMCTL_OR_RAISE(self, r);
output = remctl_output(r);
if (output == NULL)
- rb_raise(eRemctlError, "%s", rb_str_new2(remctl_error(r)));
+ rb_raise(eRemctlError, "%s", remctl_error(r));
return rb_ary_new3(5, rb_remctl_type_intern(output->type),
rb_str_new(output->data, output->length),
INT2FIX(output->stream), INT2FIX(output->status),