[Libosinfo] [PATCH db-tools 04/11] Find RNG schema in default database locations

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Fri Jul 8 12:52:21 UTC 2016


On Fri, Jul 8, 2016 at 1:34 PM, Daniel P. Berrange <berrange at redhat.com> wrote:
> On Wed, Jul 06, 2016 at 01:28:31PM +0200, Fabiano Fidêncio wrote:
>> On Tue, Jun 28, 2016 at 5:52 PM, Daniel P. Berrange <berrange at redhat.com> wrote:
>> > With the split out database, the RNG schema will no longer
>> > be installed by the code, instead it will be distributed
>> > as part of the database. Thus we should look in the database
>> > locations to find the schema.
>> >
>> > Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
>> > ---
>> >  po/POTFILES.in             |  1 +
>> >  tools/Makefile.am          |  2 +-
>> >  tools/osinfo-db-util.c     | 49 ++++++++++++++++++++++++++++++++++++++++++++++
>> >  tools/osinfo-db-util.h     |  7 +++++++
>> >  tools/osinfo-db-validate.c | 29 ++++++++++++++++++---------
>> >  5 files changed, 78 insertions(+), 10 deletions(-)
>
> [snip]
>
>> > +    for (i = 0; i < npaths; i++) {
>> > +        ret = g_file_resolve_relative_path(paths[i], file);
>> > +        if (g_file_query_exists(ret, NULL))
>> > +            break;
>> > +        g_object_unref(ret);
>> > +        ret = NULL;
>> > +    }
>> > +
>> > +    if (!ret) {
>>
>> This is just my personal preference, but I really would like to have
>> explicit comparisons in all cases that you're not checking against a
>> boolean. But feel free to ignore, probably there are a lot of other
>> places doing the same.
>
> IMHO this is pretty standard style for checking pointers for NULL
> status.

FWIW, I also prefer being explicit here.

-- 
Regards,

Zeeshan Ali (Khattak)




More information about the Libosinfo mailing list