From 18f8289645c17c96cb2ffbc46dcb3452e32d7226 Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 17 Feb 2003 13:05:48 +0000 Subject: [PATCH] * fallback to std open in list devices if resmgr is not running. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@6210 67ed7778-7388-44ab-90cf-0a291f65f57c --- libgphoto2_port/serial/unix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libgphoto2_port/serial/unix.c b/libgphoto2_port/serial/unix.c index 0d5fd10ee..766923513 100644 --- a/libgphoto2_port/serial/unix.c +++ b/libgphoto2_port/serial/unix.c @@ -337,14 +337,16 @@ gp_port_library_list (GPPortInfoList *list) continue; /* Device locked. Try to open the device. */ + fd = -1; #ifdef HAVE_RESMGR /* resmgr has its own API, which calls to a server and * communicates over UNIX domain sockets. */ fd = rsm_open_device(path, O_RDONLY | O_NDELAY); -#else - fd = open (path, O_RDONLY | O_NDELAY); + /* fall through to standard open if this failed */ #endif + if (fd == -1) + fd = open (path, O_RDONLY | O_NDELAY); if (fd < 0) { gp_port_serial_unlock (NULL, path); continue;