[libvirt] [PATCH 2/3] nss: Include stdio.h and define NULLSTR when debugging is enabled

Michal Privoznik posted 3 patches 6 years, 6 months ago
[libvirt] [PATCH 2/3] nss: Include stdio.h and define NULLSTR when debugging is enabled
Posted by Michal Privoznik 6 years, 6 months ago
The NSS module has a compile time option which when enabled makes
ERROR() and DEBUG() print messages onto stderr. But now that the
module no longer links with libvirt, we need to include stdio.h
and define NULLSTR().

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 tools/nss/libvirt_nss.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/nss/libvirt_nss.h b/tools/nss/libvirt_nss.h
index 63e1bf0af5..ee6c971d3d 100644
--- a/tools/nss/libvirt_nss.h
+++ b/tools/nss/libvirt_nss.h
@@ -33,6 +33,8 @@
 
 #if 0
 # include <errno.h>
+# include <stdio.h>
+# define NULLSTR(s) ((s) ? (s) : "<null>")
 # define ERROR(...) \
 do { \
     char ebuf[1024]; \
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/3] nss: Include stdio.h and define NULLSTR when debugging is enabled
Posted by Daniel P. Berrangé 6 years, 6 months ago
On Fri, Aug 09, 2019 at 10:49:10AM +0200, Michal Privoznik wrote:
> The NSS module has a compile time option which when enabled makes
> ERROR() and DEBUG() print messages onto stderr. But now that the
> module no longer links with libvirt, we need to include stdio.h
> and define NULLSTR().
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  tools/nss/libvirt_nss.h | 2 ++
>  1 file changed, 2 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list