All pastes #26857 Raw Edit

Untitled

public text v1 · immutable
#26857 ·published 2005-10-27 21:15 UTC
rendered paste body
  fromlen = sizeof(from);

  WX_SOCKLEN_T temp_fromlen = fromlen;

  do
  {
    if (fromlen != temp_fromlen) {
        printf("WARNING! Modified fromlen on call: %i should be %i\n",fromlen, temp_fromlen);
        happened++;
    }
    ret = recvfrom(m_fd, buffer, size, 0, &from, (WX_SOCKLEN_T *) &fromlen);
  } while (ret == -1 && errno == EINTR); /* Loop until not interrupted */

  if (ret == -1)
    return -1;

  struct sockaddr_in* temp = (struct sockaddr_in*)&from;
  if (happened) {
        printf("Happened %i times\n",happened);
          assert(temp->sin_port);
  } else {
          assert(temp->sin_port);
  }