From 9d5df5a1b305e0f44e87a25dbab9fb0f99b6130f Mon Sep 17 00:00:00 2001 From: Daniil Baturin Date: Sun, 20 Jan 2019 23:27:56 +0700 Subject: Make conversion to a char array a responsibility of Command_Succeds, not its users. --- src/hypervisor_check.adb | 6 +++--- src/hypervisor_check.ads | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/hypervisor_check.adb b/src/hypervisor_check.adb index 076348b..9923d27 100644 --- a/src/hypervisor_check.adb +++ b/src/hypervisor_check.adb @@ -85,7 +85,7 @@ package body Hypervisor_Check is return False; end if; elsif Config.FreeBSD then - return Command_Succeeds (Interfaces.C.To_C (FreeBSD_Xen_Present_Command)); + return Command_Succeeds (FreeBSD_Xen_Present_Command); else raise OS_Not_Supported; end if; @@ -105,14 +105,14 @@ package body Hypervisor_Check is -- Execute a system command and return true if it succeeded -- (i.e. returned 0) - function Command_Succeeds (Command : Interfaces.C.Char_Array) return Boolean is + function Command_Succeeds (Command : String) return Boolean is use Interfaces.C; function Sys (Arg : Char_Array) return Integer; pragma Import (C, Sys, "system"); Ret_Val : Integer; begin - Ret_Val := Sys (Command); + Ret_Val := Sys (Interfaces.C.To_C (Command)); if Ret_Val > 0 then return False; else diff --git a/src/hypervisor_check.ads b/src/hypervisor_check.ads index ced2309..3bb84be 100644 --- a/src/hypervisor_check.ads +++ b/src/hypervisor_check.ads @@ -49,7 +49,7 @@ package Hypervisor_Check is function Get_DMI_Vendor_String return US.Unbounded_String; - function Command_Succeeds (Command : Interfaces.C.Char_Array) return Boolean; + function Command_Succeeds (Command : String) return Boolean; function VirtualBox_PCI_Present return Boolean; -- cgit v1.2.3