apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: apr/test testpoll.c
Date Sat, 31 Mar 2001 22:35:05 GMT
trawick     01/03/31 14:35:05

  Modified:    test     testpoll.c
  Log:
  use apr_strerror() instead of strerror() so that we display
  reasonable strings on non-Unix
  
  Revision  Changes    Path
  1.2       +7 -2      apr/test/testpoll.c
  
  Index: testpoll.c
  ===================================================================
  RCS file: /home/cvs/apr/test/testpoll.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- testpoll.c	2001/03/22 21:50:12	1.1
  +++ testpoll.c	2001/03/31 22:35:04	1.2
  @@ -113,9 +113,12 @@
   {
       apr_size_t len = 5;
       apr_status_t rv;
  +    char errmsg[120];
  +
       printf("\tSending message to socket %d............", which);
       if ((rv = apr_sendto(sockarray[which], sas[which], 0, "hello", &len)) != APR_SUCCESS){
  -        printf("Failed! %s\n", strerror(rv));
  +        apr_strerror(rv, errmsg, sizeof errmsg);
  +        printf("Failed! %s\n", errmsg);
           exit(-1);
       }
       printf("OK\n");
  @@ -127,13 +130,15 @@
       char *buffer = apr_pcalloc(p, sizeof(char) * buflen);
       apr_sockaddr_t *recsa;
       apr_status_t rv;
  +    char errmsg[120];
   
       apr_sockaddr_info_get(&recsa, "127.0.0.1", APR_UNSPEC, 7770, 0, p);
   
       printf("\tTrying to get message from socket %d....", which);
       if ((rv = apr_recvfrom(recsa, sockarray[which], 0, buffer, &buflen))
           != APR_SUCCESS){
  -        printf("Failed! %s\n", strerror(rv));
  +        apr_strerror(rv, errmsg, sizeof errmsg);
  +        printf("Failed! %s\n", errmsg);
           exit (-1);
       }
       printf("OK\n");
  
  
  

Mime
View raw message