diff options
author | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-04 14:59:16 +0100 |
---|---|---|
committer | Richard Jones <rjones@trick.home.annexia.org> | 2009-06-04 15:06:27 +0100 |
commit | b6adf09c4d2cc3f1d0285950c151b1fd7688ec67 (patch) | |
tree | 7ff59df24162a39824e65bf5e4fd0b4dafcad13a /ruby | |
parent | 2ef06eacc2be08b0268c98a4d157176aff9356e0 (diff) | |
download | libguestfs-b6adf09c4d2cc3f1d0285950c151b1fd7688ec67.tar.gz libguestfs-b6adf09c4d2cc3f1d0285950c151b1fd7688ec67.tar.xz libguestfs-b6adf09c4d2cc3f1d0285950c151b1fd7688ec67.zip |
Generated code for the 'sleep' command.
Diffstat (limited to 'ruby')
-rw-r--r-- | ruby/ext/guestfs/_guestfs.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ruby/ext/guestfs/_guestfs.c b/ruby/ext/guestfs/_guestfs.c index 4983932f..661e3716 100644 --- a/ruby/ext/guestfs/_guestfs.c +++ b/ruby/ext/guestfs/_guestfs.c @@ -3963,6 +3963,24 @@ static VALUE ruby_guestfs_e2fsck_f (VALUE gv, VALUE devicev) return Qnil; } +static VALUE ruby_guestfs_sleep (VALUE gv, VALUE secsv) +{ + guestfs_h *g; + Data_Get_Struct (gv, guestfs_h, g); + if (!g) + rb_raise (rb_eArgError, "%s: used handle after closing it", "sleep"); + + int secs = NUM2INT (secsv); + + int r; + + r = guestfs_sleep (g, secs); + if (r == -1) + rb_raise (e_Error, "%s", guestfs_last_error (g)); + + return Qnil; +} + /* Initialize the module. */ void Init__guestfs () { @@ -4293,4 +4311,6 @@ void Init__guestfs () ruby_guestfs_find, 1); rb_define_method (c_guestfs, "e2fsck_f", ruby_guestfs_e2fsck_f, 1); + rb_define_method (c_guestfs, "sleep", + ruby_guestfs_sleep, 1); } |