From e18e3674b53dce63a88f58387ad5109c6b780716 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 8 Jan 2013 11:29:31 +0900 Subject: [PATCH 5/7] java: Use defined constants for flags in call to guestfs_create_flags. --- generator/java.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/generator/java.ml b/generator/java.ml index 270ad44..1879f50 100644 --- a/generator/java.ml +++ b/generator/java.ml @@ -67,6 +67,10 @@ public class GuestFS { */ long g; + /* guestfs_create_flags values defined in */ + private static int CREATE_NO_ENVIRONMENT = 1; + private static int CREATE_NO_CLOSE_ON_EXIT = 2; + /** * Create a libguestfs handle, setting flags. * @@ -82,11 +86,11 @@ public class GuestFS { if (optargs != null) _optobj = optargs.get (\"environment\"); if (_optobj != null && !((Boolean) _optobj).booleanValue()) - flags |= 1; + flags |= CREATE_NO_ENVIRONMENT; if (optargs != null) _optobj = optargs.get (\"close_on_exit\"); if (_optobj != null && !((Boolean) _optobj).booleanValue()) - flags |= 2; + flags |= CREATE_NO_CLOSE_ON_EXIT; g = _create (flags); } @@ -100,6 +104,7 @@ public class GuestFS { { g = _create (0); } + private native long _create (int flags) throws LibGuestFSException; /** -- 1.7.11.7