From 9902e2fca35ea7e11057d393a632955eb7039728 Mon Sep 17 00:00:00 2001 From: Lutz Mueller Date: Fri, 12 Oct 2001 14:56:15 +0000 Subject: [PATCH] *** empty log message *** git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@2501 67ed7778-7388-44ab-90cf-0a291f65f57c --- libgphoto2/camera.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libgphoto2/camera.c b/libgphoto2/camera.c index 73b578edd..49fac1099 100644 --- a/libgphoto2/camera.c +++ b/libgphoto2/camera.c @@ -51,8 +51,8 @@ static int glob_session_camera = 0; #define CHECK_NULL(r) {if (!(r)) return (GP_ERROR_BAD_PARAMETERS);} #define CHECK_RESULT(result) {int r = (result); if (r < 0) return (r);} -#define CHECK_OPEN(c) {int r = gp_port_open ((c)->port); if (r < 0) {gp_camera_status ((c), ""); return (r);}} -#define CHECK_CLOSE(c) {gp_port_close ((c)->port);} +#define CHECK_OPEN(c) {int r = ((c)->port ? gp_port_open ((c)->port) : GP_OK); if (r < 0) {gp_camera_status ((c), ""); return (r);}} +#define CHECK_CLOSE(c) {if ((c)->port) gp_port_close ((c)->port);} #define CRS(c,res) {int r = (res); if (r < 0) {gp_camera_status ((c), ""); return (r);}}