You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by hi...@apache.org on 2007/01/25 12:50:06 UTC
svn commit: r499751 -
/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c
Author: hindessm
Date: Thu Jan 25 03:50:06 2007
New Revision: 499751
URL: http://svn.apache.org/viewvc?view=rev&rev=499751
Log:
Proper fix for FreeBSD compile problem.
Modified:
harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c
Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c?view=diff&rev=499751&r1=499750&r2=499751
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c (original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/test/native/hyfile/shared/hyfile.c Thu Jan 25 03:50:06 2007
@@ -21,6 +21,8 @@
#include "hycomp.h"
#include "hyport.h"
+void cleanup(HyPortLibrary hyportLibrary);
+
int main (int argc, char **argv, char **envp)
{
HyPortLibrary hyportLibrary;
@@ -51,7 +53,7 @@
if (!fd) {
fprintf(stderr, "Failed to open hytest.tmp for write %s\n",
hyportLibrary.error_last_error_message(&hyportLibrary));
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -59,7 +61,7 @@
printf(" hyfile_write wrote %d bytes\n", bytes);
if (bytes != 7) {
fprintf(stderr, "hyfile_write wrote %d bytes not %d\n", bytes, 7);
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -67,7 +69,7 @@
if (rc != 0) {
fprintf(stderr, "hyfile_write_text write failed: %s\n",
hyportLibrary.error_last_error_message(&hyportLibrary));
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -76,7 +78,7 @@
if (rc != 0) {
fprintf(stderr, "hyfile_sync failed %s\n",
hyportLibrary.error_last_error_message(&hyportLibrary));
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -84,7 +86,7 @@
if (rc != 0) {
fprintf(stderr, "hyfile_close failed %s\n",
hyportLibrary.error_last_error_message(&hyportLibrary));
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -92,7 +94,7 @@
if (rc != 0) {
fprintf(stderr, "hyfile_move failed %s\n",
hyportLibrary.error_last_error_message(&hyportLibrary));
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -102,7 +104,7 @@
if (!fd) {
fprintf(stderr, "Failed to open hytest.tmp2 for read %s\n",
hyportLibrary.error_last_error_message(&hyportLibrary));
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -110,7 +112,7 @@
printf(" offset = %d\n", offset);
if (offset != 7) {
fprintf(stderr, "Failed to seek hytest.tmp2\n");
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -120,13 +122,13 @@
printf(" buf = %s\n", buf);
if (bytes != 10) {
fprintf(stderr, "Failed to read hytest.tmp2\n");
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
if (strcmp(buf, "testing123") != 0) {
fprintf(stderr, "Failed to read correct content from hytest.tmp2\n");
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -134,7 +136,7 @@
if (rc != 0) {
fprintf(stderr, "hyfile_close failed %s\n",
hyportLibrary.error_last_error_message(&hyportLibrary));
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -142,13 +144,13 @@
printf(" length = %d\n", length);
if (length != 18) {
fprintf(stderr, "hytest.tmp2 has incorrect length\n");
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
if (hyportLibrary.file_attr(&hyportLibrary, "hytest.tmp2") != HyIsFile) {
fprintf(stderr, "hytest.tmp2 has incorrect type\n");
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -156,7 +158,7 @@
if (rc != 0) {
fprintf(stderr, "hyfile_unlink failed %s\n",
hyportLibrary.error_last_error_message(&hyportLibrary));
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -164,13 +166,13 @@
if (rc != 0) {
fprintf(stderr, "hyfile_mkdir failed %s\n",
hyportLibrary.error_last_error_message(&hyportLibrary));
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
if (hyportLibrary.file_attr(&hyportLibrary, "hytest.dir.tmp") != HyIsDir) {
fprintf(stderr, "hytest.dir.tmp has incorrect type\n");
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -178,7 +180,7 @@
if (rc != 0) {
fprintf(stderr, "hyfile_unlinkdir failed %s\n",
hyportLibrary.error_last_error_message(&hyportLibrary));
- hycleanup(hyportLibrary);
+ cleanup(hyportLibrary);
exit(1);
}
@@ -191,7 +193,7 @@
return 0;
}
-void hycleanup(HyPortLibrary hyportLibrary)
+void cleanup(HyPortLibrary hyportLibrary)
{
hyportLibrary.file_unlink(&hyportLibrary, "hytest.tmp");
hyportLibrary.file_unlink(&hyportLibrary, "hytest.tmp2");