Revision a34ed273

View differences:

input-grapes.c
107 107
      delta = 0;
108 108
    }
109 109
  } else {
110
    delta = 999999;		/* FIXME */
110
    delta = 0;		/* Will not be used */
111 111
  }
112 112
  c->timestamp = now.tv_sec * 1000000ULL + now.tv_usec;
113 113

  
loop.c
123 123
  }
124 124
  while (!done) {
125 125
    int len, res;
126
    struct timeval tv;
127
    int wait4fds[FDSSIZE];
126
    struct timeval tv, *ptv;
127
    int wait4fds[FDSSIZE], *pfds;
128 128

  
129 129
#ifdef HTTPIO
130 130
    memcpy(wait4fds, fds, sizeof(fds));
131 131
    res = wait4data(s, NULL, wait4fds);
132 132
#else
133
    tout_init(&tv);
134
    memcpy(wait4fds, fds, sizeof(fds));
135
    res = wait4data(s, &tv, wait4fds);
133
    if (fds[0] == -1) {
134
      tout_init(&tv);
135
      ptv = &tv;
136
      pfds = NULL;
137
    } else {
138
      memcpy(wait4fds, fds, sizeof(fds));
139
      pfds = wait4fds;
140
      ptv = NULL;
141
    }
142
    res = wait4data(s, ptv, pfds);
136 143
#endif
137 144
    if (res == 1) {
138 145
      struct nodeID *remote;

Also available in: Unified diff