From 018c1d8cfcdbdb86cd327d0a56d45783816f755c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Thu, 26 Aug 2010 20:12:29 +0000 Subject: [PATCH] src/tap/cable/gpio.c (gpio_get_value): Replace read/lseek with pread. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1834 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 2 ++ urjtag/src/tap/cable/gpio.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 568c0038..39c0ea68 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -4,6 +4,8 @@ the gpio value. Also assume the gpio layer only has a value of '0' or '1'. Work by Frans Meulenbroeks. + * src/tap/cable/gpio.c (gpio_get_value): Replace read/lseek with pread. + 2010-08-24 Mike Frysinger * src/tap/cable/gpio.c (gpio_get_value): Need to seek back to the start of diff --git a/urjtag/src/tap/cable/gpio.c b/urjtag/src/tap/cable/gpio.c index f02fdead..edb88174 100644 --- a/urjtag/src/tap/cable/gpio.c +++ b/urjtag/src/tap/cable/gpio.c @@ -133,8 +133,7 @@ static int gpio_get_value (int fd, unsigned int gpio) ssize_t ret; char value; - ret = read (fd, &value, 1); - lseek (fd, 0, SEEK_SET); + ret = pread (fd, &value, 1, 0); if (ret != 1) {