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:25:19 UTC
svn commit: r584588 - in /apr/apr/branches/1.2.x/test: proc_child.c
sockchild.c
Author: wrowe
Date: Sun Oct 14 12:25:18 2007
New Revision: 584588
URL: http://svn.apache.org/viewvc?rev=584588&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.
Backport: 584587
Modified:
apr/apr/branches/1.2.x/test/proc_child.c
apr/apr/branches/1.2.x/test/sockchild.c
Modified: apr/apr/branches/1.2.x/test/proc_child.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/proc_child.c?rev=584588&r1=584587&r2=584588&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/test/proc_child.c (original)
+++ apr/apr/branches/1.2.x/test/proc_child.c Sun Oct 14 12:25:18 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/branches/1.2.x/test/sockchild.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/test/sockchild.c?rev=584588&r1=584587&r2=584588&view=diff
==============================================================================
--- apr/apr/branches/1.2.x/test/sockchild.c (original)
+++ apr/apr/branches/1.2.x/test/sockchild.c Sun Oct 14 12:25:18 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);
}