From 825b82ef61bbe88757131862e09d4b1819f4336d Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Tue, 11 Feb 2014 21:45:47 -0500 Subject: [PATCH] shinkos2145: fast return needed tweaking. --- backend_shinkos2145.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/backend_shinkos2145.c b/backend_shinkos2145.c index 70c6151..90cd798 100644 --- a/backend_shinkos2145.c +++ b/backend_shinkos2145.c @@ -1357,9 +1357,10 @@ int shinkos2145_cmdline_arg(void *vctx, int argc, char **argv) else return 1; case 'f': - if (ctx) + if (ctx) { ctx->fast_return = 1; - else + return 0; + } else return 1; case 'F': if (ctx) @@ -1432,7 +1433,7 @@ static void *shinkos2145_init(void) memset(ctx, 0, sizeof(struct shinkos2145_ctx)); /* Use Fast return by default in CUPS mode */ - if (getenv("DEVICE_URI")) + if (getenv("DEVICE_URI") || getenv("FAST_RETURN")) ctx->fast_return = 1; return ctx; @@ -1443,7 +1444,6 @@ static void shinkos2145_attach(void *vctx, struct libusb_device_handle *dev, { struct shinkos2145_ctx *ctx = vctx; - ctx->dev = dev; ctx->endp_up = endp_up; ctx->endp_down = endp_down;