You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2007/10/14 21:24:12 UTC
svn commit: r584587 - in /apr/apr/trunk/test: proc_child.c sockchild.c
Author: wrowe
Date: Sun Oct 14 12:24:12 2007
New Revision: 584587
URL: http://svn.apache.org/viewvc?rev=584587&view=rev
Log:
Solve two int-size issues on some platforms; exit is well defined
to return an (int) while on some platforms read/write is still
expressed as unsigned int bytes of data. Both harmless truncations.
Modified:
apr/apr/trunk/test/proc_child.c
apr/apr/trunk/test/sockchild.c
Modified: apr/apr/trunk/test/proc_child.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/proc_child.c?rev=584587&r1=584586&r2=584587&view=diff
==============================================================================
--- apr/apr/trunk/test/proc_child.c (original)
+++ apr/apr/trunk/test/proc_child.c Sun Oct 14 12:24:12 2007
@@ -11,11 +11,11 @@
int main(void)
{
char buf[256];
- apr_ssize_t bytes;
+ int bytes;
- bytes = read(STDIN_FILENO, buf, 256);
+ bytes = (int)read(STDIN_FILENO, buf, 256);
if (bytes > 0)
- write(STDOUT_FILENO, buf, bytes);
+ write(STDOUT_FILENO, buf, (unsigned int)bytes);
return 0; /* just to keep the compiler happy */
}
Modified: apr/apr/trunk/test/sockchild.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/test/sockchild.c?rev=584587&r1=584586&r2=584587&view=diff
==============================================================================
--- apr/apr/trunk/test/sockchild.c (original)
+++ apr/apr/trunk/test/sockchild.c Sun Oct 14 12:24:12 2007
@@ -67,14 +67,14 @@
exit(-1);
}
- exit(length);
+ exit((int)length);
}
else if (!strcmp("write", argv[1])) {
apr_size_t length = strlen(DATASTR);
apr_socket_send(sock, DATASTR, &length);
apr_socket_close(sock);
- exit(length);
+ exit((int)length);
}
exit(-1);
}