Print error codes if PR_Read fails.

This commit is contained in:
wtc%netscape.com 2003-05-23 06:19:11 +00:00
parent 285c623645
commit edfd28316b

View File

@ -124,7 +124,8 @@ int main()
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
nBytes = PR_Read(sock[0], buf, sizeof(buf)); nBytes = PR_Read(sock[0], buf, sizeof(buf));
if (nBytes == -1) { if (nBytes == -1) {
fprintf(stderr, "PR_Read failed\n"); fprintf(stderr, "PR_Read failed: (%d, %d)\n",
PR_GetError(), PR_GetOSError());
exit(1); exit(1);
} }
printf("ping process: received \"%s\"\n", buf); printf("ping process: received \"%s\"\n", buf);