~ubuntu-branches/ubuntu/hardy/gnupg2/hardy-proposed

« back to all changes in this revision

Viewing changes to scd/ccid-driver.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Bienia
  • Date: 2007-05-15 13:54:55 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070515135455-89qfyalmgjy6gcqw
Tags: 2.0.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Remove libpcsclite-dev, libopensc2-dev build dependencies (they are in
    universe).
  - Build-depend on libcurl3-gnutls-dev
  - g10/call-agent.c: set DBG_ASSUAN to 0 to suppress a debug message
  - Include /doc files as done with gnupg
  - debian/rules: add doc/com-certs.pem to the docs for gpgsm
  - debian/copyright: update download url
  - debian/README.Debian: remove note the gnupg2 isn't released yet.
  - debian/control: Change Maintainer/XSBC-Original-Maintainer field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
54
54
 * OF THE POSSIBILITY OF SUCH DAMAGE.
55
55
 *
56
 
 * $Date: 2007-03-07 21:55:14 +0100 (Wed, 07 Mar 2007) $
 
56
 * $Date: 2007-04-03 18:57:37 +0200 (Tue, 03 Apr 2007) $
57
57
 */
58
58
 
59
59
 
989
989
      char *rid, *p;
990
990
 
991
991
      fd = open (transports[i].name, O_RDWR);
992
 
      if (fd == -1)
 
992
      if (fd == -1 && scan_mode && errno == EBUSY)
 
993
        {
 
994
          /* Ignore this error in scan mode because it indicates that
 
995
             the device exists but is already open (most likely by us)
 
996
             and thus in general suitable as a reader.  */
 
997
        }
 
998
      else if (fd == -1)
993
999
        {
994
1000
          DEBUGOUT_2 ("failed to open `%s': %s\n",
995
1001
                     transports[i].name, strerror (errno));
999
1005
      rid = malloc (strlen (transports[i].name) + 30 + 10);
1000
1006
      if (!rid)
1001
1007
        {
1002
 
          close (fd);
 
1008
          if (fd != -1)
 
1009
            close (fd);
1003
1010
          free (rid_list);
1004
1011
          return -1; /* Error. */
1005
1012
        }
1010
1017
          p = malloc ((rid_list? strlen (rid_list):0) + 1 + strlen (rid) + 1);
1011
1018
          if (!p)
1012
1019
            {
1013
 
              close (fd);
 
1020
              if (fd != -1)
 
1021
                close (fd);
1014
1022
              free (rid_list);
1015
1023
              free (rid);
1016
1024
              return -1; /* Error. */
1046
1054
            --readerno;
1047
1055
        }
1048
1056
      free (rid);
1049
 
      close (fd);
 
1057
      if (fd != -1)
 
1058
        close (fd);
1050
1059
    }
1051
1060
 
1052
1061
  if (scan_mode)