~ubuntu-branches/ubuntu/hardy/file/hardy-proposed

« back to all changes in this revision

Viewing changes to src/compress.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2007-06-01 20:29:00 UTC
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: james.westby@ubuntu.com-20070601202900-gzjrg1s331z9632p
Tags: upstream-4.21
ImportĀ upstreamĀ versionĀ 4.21

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
 
56
56
 
57
57
#ifndef lint
58
 
FILE_RCSID("@(#)$File: compress.c,v 1.50 2007/03/01 22:14:54 christos Exp $")
 
58
FILE_RCSID("@(#)$File: compress.c,v 1.51 2007/03/05 02:41:29 christos Exp $")
59
59
#endif
60
60
 
61
61
private struct {
170
170
                goto nocheck;
171
171
 
172
172
#ifdef FIONREAD
173
 
        if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1) || (t == 0)) {
 
173
        if ((canbepipe && (ioctl(fd, FIONREAD, &t) == -1)) || (t == 0)) {
174
174
#ifdef FD_ZERO
175
175
                for (cnt = 0;; cnt++) {
176
176
                        fd_set check;
177
177
                        struct timeval tout = {0, 100 * 1000};
178
 
                        int rv;
 
178
                        int selrv;
179
179
 
180
180
                        FD_ZERO(&check);
181
181
                        FD_SET(fd, &check);
184
184
                         * Avoid soft deadlock: do not read if there
185
185
                         * is nothing to read from sockets and pipes.
186
186
                         */
187
 
                        rv = select(fd + 1, &check, NULL, NULL, &tout);
188
 
                        if (rv == -1) {
 
187
                        selrv = select(fd + 1, &check, NULL, NULL, &tout);
 
188
                        if (selrv == -1) {
189
189
                                if (errno == EINTR || errno == EAGAIN)
190
190
                                        continue;
191
 
                        } else if (rv == 0 && cnt >= 5) {
 
191
                        } else if (selrv == 0 && cnt >= 5) {
192
192
                                return 0;
193
193
                        } else
194
194
                                break;