Weird New libjava Testsuite Failure (PR java/14104)

Andrew Haley aph@redhat.com
Wed Mar 17 22:03:00 GMT 2004


The test failure "linking simple" is because the error handling in
opendir_in_zip() is quite insane. This patch tidies up that error
handling.
Andrew.
2004年03月17日 Andrew Haley <aph@redhat.com>
	PR java/14104
	* jcf-io.c (opendir_in_zip): Tidy up error handling for all
	control flow paths.
Index: jcf-io.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jcf-io.c,v
retrieving revision 1.48
diff -p -2 -c -r1.48 jcf-io.c
*** jcf-io.c	20 Dec 2003 15:38:27 -0000	1.48
--- jcf-io.c	17 Mar 2004 13:58:19 -0000
*************** opendir_in_zip (const char *zipfile, int
*** 121,125 ****
 zipf->name = (char*)(zipf+1);
 strcpy (zipf->name, zipfile);
- SeenZipFiles = zipf;
 fd = open (zipfile, O_RDONLY | O_BINARY);
 zipf->fd = fd;
--- 121,124 ----
*************** opendir_in_zip (const char *zipfile, int
*** 128,134 ****
 /* A missing zip file is not considered an error.
 We may want to re-consider that. FIXME. */
! zipf->count = 0;
! zipf->dir_size = 0;
! zipf->central_directory = NULL;
 }
 else
--- 127,131 ----
 /* A missing zip file is not considered an error.
 We may want to re-consider that. FIXME. */
! goto fail;
 }
 else
*************** opendir_in_zip (const char *zipfile, int
*** 136,145 ****
 jcf_dependency_add_file (zipfile, is_system);
 if (read (fd, magic, 4) != 4 || GET_u4 (magic) != (JCF_u4)ZIPMAGIC)
! 	return NULL;
 lseek (fd, 0L, SEEK_SET);
 if (read_zip_archive (zipf) != 0)
! 	return NULL;
 }
 return zipf;
 }
 
--- 133,150 ----
 jcf_dependency_add_file (zipfile, is_system);
 if (read (fd, magic, 4) != 4 || GET_u4 (magic) != (JCF_u4)ZIPMAGIC)
! 	goto fail;
 lseek (fd, 0L, SEEK_SET);
 if (read_zip_archive (zipf) != 0)
! 	goto fail;
 }
+ 
+ SeenZipFiles = zipf; 
 return zipf;
+ 
+ fail:
+ zipf->count = 0;
+ zipf->dir_size = 0;
+ zipf->central_directory = NULL;
+ return NULL;
 }
 


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /