~ubuntu-branches/ubuntu/lucid/curl/lucid-201101212007

« back to all changes in this revision

Viewing changes to tests/libtest/first.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-05-16 15:16:54 UTC
  • mto: (3.1.1 lenny) (1.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20070516151654-x9nkigtr2j0i8d0v
Tags: upstream-7.16.2
ImportĀ upstreamĀ versionĀ 7.16.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 *                                  _   _ ____  _
 
3
 *  Project                     ___| | | |  _ \| |
 
4
 *                             / __| | | | |_) | |
 
5
 *                            | (__| |_| |  _ <| |___
 
6
 *                             \___|\___/|_| \_\_____|
 
7
 *
 
8
 * $Id: first.c,v 1.14 2006-10-25 09:20:44 yangtse Exp $
 
9
 */
 
10
 
1
11
#include "test.h"
2
12
 
3
13
#ifdef CURLDEBUG
9
19
/* test is provided in the test code file */
10
20
int test(char *url);
11
21
 
 
22
int select_test (int num_fds, fd_set *rd, fd_set *wr, fd_set *exc,
 
23
                 struct timeval *tv)
 
24
{
 
25
#ifdef USE_WINSOCK
 
26
  /* Winsock doesn't like no socket set in 'rd', 'wr' or 'exc'. This is
 
27
   * case when 'num_fds <= 0. So sleep.
 
28
   */
 
29
  if (num_fds <= 0) {
 
30
    Sleep(1000*tv->tv_sec + tv->tv_usec/1000);
 
31
    return 0;
 
32
  }
 
33
#endif
 
34
  return select(num_fds, rd, wr, exc, tv);
 
35
}
 
36
 
12
37
char *arg2=NULL;
13
38
 
14
39
int main(int argc, char **argv)