diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2013-09-27 15:12:14 +0100 |
---|---|---|
committer | Daniel P. Berrange <berrange@redhat.com> | 2013-11-12 18:02:07 +0000 |
commit | b3d1e58b6e0d2317015660c440960844e54940b0 (patch) | |
tree | c39fc2c458f7d19d4a61e8ad97d5b661d409a3ec /libvirt-utils.h | |
parent | 63af664b68c388b421a584868c88e9d41f9c7f7f (diff) | |
download | libvirt-python-v6-b3d1e58b6e0d2317015660c440960844e54940b0.tar.gz libvirt-python-v6-b3d1e58b6e0d2317015660c440960844e54940b0.tar.xz libvirt-python-v6-b3d1e58b6e0d2317015660c440960844e54940b0.zip |
Import VIR_FORCE_CLOSE macro from libvirt
Import the macro for safely closing file descriptors
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'libvirt-utils.h')
-rw-r--r-- | libvirt-utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libvirt-utils.h b/libvirt-utils.h index 93a2541..1b26413 100644 --- a/libvirt-utils.h +++ b/libvirt-utils.h @@ -183,4 +183,11 @@ void virFree(void *ptrptr) ATTRIBUTE_NONNULL(1); # define VIR_FREE(ptr) virFree((void *) &(ptr)) # endif +/* Don't call this directly - use the macro below */ +int virFileClose(int *fdptr) + ATTRIBUTE_RETURN_CHECK; + +# define VIR_FORCE_CLOSE(FD) \ + ignore_value(virFileClose(&(FD))) + #endif /* __LIBVIRT_UTILS_H__ */ |