aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2011-06-14 11:44:26 +0200
committerClemens Ladisch <clemens@ladisch.de>2012-05-18 14:00:40 +0200
commit700e8e323f0c1a5f4c3361b43f0110fbfc296abd (patch)
tree053969ece122e68001cd239a0669ccd1b78e4423
parent6f466e66c80c64e90fc4be823ab3d0872e0c416f (diff)
downloadlinux-firewire-utils-700e8e323f0c1a5f4c3361b43f0110fbfc296abd.tar.gz
firewire-request: remove response timeout
We do not need to implement a timeout for unacked requests because the kernel already guarantees to send a RCODE_CANCELLED response for those.
-rw-r--r--src/firewire-request.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/src/firewire-request.c b/src/firewire-request.c
index b44fc05..2bba44b 100644
--- a/src/firewire-request.c
+++ b/src/firewire-request.c
@@ -84,22 +84,10 @@ static void open_device(void)
static struct fw_cdev_event_response *wait_for_response(void)
{
static u8 buf[sizeof(struct fw_cdev_event_response) + 16384];
- struct pollfd pfd;
- int ready, r;
+ int r;
struct fw_cdev_event_common *event;
- pfd.fd = fd;
- pfd.events = POLLIN;
for (;;) {
- ready = poll(&pfd, 1, 123);
- if (ready < 0) {
- perror("poll failed");
- exit(EXIT_FAILURE);
- }
- if (!ready) {
- fputs("timeout (no ack)\n", stderr);
- exit(EXIT_FAILURE);
- }
r = read(fd, buf, sizeof buf);
if (r < sizeof(struct fw_cdev_event_common)) {
fputs("short read\n", stderr);
@@ -344,13 +332,14 @@ static void do_fcp(void)
pfd.fd = fd;
pfd.events = POLLIN;
while (!ack_received || !response_received) {
- ready = poll(&pfd, 1, 123);
+ /* XXX what's a practical timeout for FCP responses? */
+ ready = poll(&pfd, 1, 2345);
if (ready < 0) {
perror("poll failed");
exit(EXIT_FAILURE);
}
if (!ready) {
- fprintf(stderr, "timeout (%s)\n", !ack_received ? "no ack" : "no response");
+ fputs("timeout\n", stderr);
exit(EXIT_FAILURE);
}
r = read(fd, buf, sizeof buf);