Re: [libosinfo] osinfo-query: return failure when no matches are found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 1, 2016 at 10:46 AM, Christophe Fergeau <cfergeau@xxxxxxxxxx> wrote:
> On Thu, Jun 30, 2016 at 07:04:10PM +0200, Fabiano Fidêncio wrote:
>> According to `man osinfo-query`: "The exit status will be 0 if matching
>> entries were found, or 1 if not matches were found". So, let's adapt the
>> program in order to match the manual.
>>
>> Also, this patch was written keeping the current behavior about printing
>> the Short ID, Name, Version, ID table.
>>
>> Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1351718
>>
>> Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
>> ---
>>  tools/osinfo-query.c | 14 ++++++++++++--
>>  1 file changed, 12 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/osinfo-query.c b/tools/osinfo-query.c
>> index 66f49e2..48e792f 100644
>> --- a/tools/osinfo-query.c
>> +++ b/tools/osinfo-query.c
>> @@ -331,6 +331,9 @@ static gboolean print_results_text(OsinfoList *list,
>>      }
>>      g_print("\n");
>>
>> +    if (tmp == NULL)
>> +        goto end;
>> +
>
> You could add a short /* No match /* comment before this if() or the
> goto.

Suggestion taken, patch pushed!

Best Regards,
-- 
Fabiano Fidêncio

_______________________________________________
Libosinfo mailing list
Libosinfo@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libosinfo




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux