aboutsummaryrefslogtreecommitdiffstats
path: root/scd
diff options
context:
space:
mode:
Diffstat (limited to 'scd')
-rw-r--r--scd/ChangeLog10
-rw-r--r--scd/apdu.c1
-rw-r--r--scd/ccid-driver.c39
-rw-r--r--scd/sc-copykeys.c4
-rw-r--r--scd/scdaemon.c4
5 files changed, 46 insertions, 12 deletions
diff --git a/scd/ChangeLog b/scd/ChangeLog
index 46b15f0c7..59487fe17 100644
--- a/scd/ChangeLog
+++ b/scd/ChangeLog
@@ -1,3 +1,13 @@
+2009-07-21 Werner Koch <[email protected]>
+
+ * ccid-driver.c [HAVE_PTH]: Include pth.h.
+ (my_sleep): New.
+ (bulk_in): s/gnupg_sleep/my_sleep/.
+
+2009-07-20 Werner Koch <[email protected]>
+
+ * apdu.c [GNUPG_MAJOR_VERSION==1]: Include dynload.h.
+
2009-07-16 Werner Koch <[email protected]>
* command.c (update_reader_status_file): Test for unplugged reader.
diff --git a/scd/apdu.c b/scd/apdu.c
index 36bae89c0..d114b6eca 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -54,6 +54,7 @@
#include "memory.h"
#include "util.h"
#include "i18n.h"
+#include "dynload.h"
#include "cardglue.h"
#else /* GNUPG_MAJOR_VERSION != 1 */
#include "scdaemon.h"
diff --git a/scd/ccid-driver.c b/scd/ccid-driver.c
index 373f55f8a..b71c43c29 100644
--- a/scd/ccid-driver.c
+++ b/scd/ccid-driver.c
@@ -85,6 +85,9 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
+#ifdef HAVE_PTH
+# include <pth.h>
+#endif /*HAVE_PTH*/
#include <usb.h>
@@ -312,6 +315,30 @@ set_msg_len (unsigned char *msg, unsigned int length)
static void
+my_sleep (int seconds)
+{
+#ifdef HAVE_PTH
+ /* With Pth we also call the standard sleep(0) so that the process
+ may give up its timeslot. */
+ if (!seconds)
+ {
+# ifdef HAVE_W32_SYSTEM
+ Sleep (0);
+# else
+ sleep (0);
+# endif
+ }
+ pth_sleep (seconds);
+#else
+# ifdef HAVE_W32_SYSTEM
+ Sleep (seconds*1000);
+# else
+ sleep (seconds);
+# endif
+#endif
+}
+
+static void
print_progress (ccid_driver_t handle)
{
time_t ct = time (NULL);
@@ -1766,8 +1793,8 @@ bulk_out (ccid_driver_t handle, unsigned char *msg, size_t msglen,
{
int rc;
- /* No need to continue and clutter the log withy USB error if we
- ever got an ENODEV. */
+ /* No need to continue and clutter the log with USB write error
+ messages after we got the first ENODEV. */
if (handle->enodev_seen)
return CCID_DRIVER_ERR_NO_READER;
@@ -1900,9 +1927,7 @@ bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length,
DEBUGOUT_1 ("usb_bulk_read error: %s\n", strerror (rc));
if (rc == EAGAIN && eagain_retries++ < 3)
{
-#ifndef TEST
- gnupg_sleep (1);
-#endif
+ my_sleep (1);
goto retry;
}
return CCID_DRIVER_ERR_CARD_IO_ERROR;
@@ -1919,9 +1944,7 @@ bulk_in (ccid_driver_t handle, unsigned char *buffer, size_t length,
handle->dev_fd, strerror (rc));
if (rc == EAGAIN && eagain_retries++ < 5)
{
-#ifndef TEST
- gnupg_sleep (1);
-#endif
+ my_sleep (1);
goto retry;
}
return CCID_DRIVER_ERR_CARD_IO_ERROR;
diff --git a/scd/sc-copykeys.c b/scd/sc-copykeys.c
index 275bcf877..615e4b28a 100644
--- a/scd/sc-copykeys.c
+++ b/scd/sc-copykeys.c
@@ -76,8 +76,8 @@ my_strusage (int level)
break;
case 13: p = VERSION; break;
case 17: p = PRINTABLE_OS_NAME; break;
- case 19: p = _("Please report bugs to <" PACKAGE_BUGREPORT ">.\n");
- break;
+ case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
+
case 1:
case 40: p = _("Usage: sc-copykeys [options] (-h for help)\n");
break;
diff --git a/scd/scdaemon.c b/scd/scdaemon.c
index 24cb346e6..175729a03 100644
--- a/scd/scdaemon.c
+++ b/scd/scdaemon.c
@@ -242,8 +242,8 @@ my_strusage (int level)
break;
case 13: p = VERSION; break;
case 17: p = PRINTABLE_OS_NAME; break;
- case 19: p = _("Please report bugs to <" PACKAGE_BUGREPORT ">.\n");
- break;
+ case 19: p = _("Please report bugs to <@EMAIL@>.\n"); break;
+
case 20:
if (!ver_gcry)
ver_gcry = make_libversion ("libgcrypt", gcry_check_version);