X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fjavacomp.c;h=caff268a40cf13a38258c063a1b988107e9b3f64;hb=d90792110b23736fb629c7f3ee150d917e8e9e3a;hp=859d0725b501d8663af35464a62ba8ebe20ee65b;hpb=18eedd96914ce2143792d1c98879ebbf8a369361;p=gnulib.git diff --git a/lib/javacomp.c b/lib/javacomp.c index 859d0725b..caff268a4 100644 --- a/lib/javacomp.c +++ b/lib/javacomp.c @@ -1,5 +1,5 @@ /* Compile a Java program. - Copyright (C) 2001-2003, 2006 Free Software Foundation, Inc. + Copyright (C) 2001-2003, 2006-2007 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -16,9 +16,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include /* Specification. */ @@ -50,11 +48,16 @@ #include "clean-temp.h" #include "error.h" #include "xvasprintf.h" -#include "strstr.h" +#include "c-strstr.h" #include "gettext.h" #define _(str) gettext (str) +/* The results of open() in this file are not used with fchdir, + therefore save some unnecessary work in fchdir.c. */ +#undef open +#undef close + /* Survey of Java compilers. @@ -469,7 +472,7 @@ write_temp_file (struct temp_dir *tmpdir, const char *file_name, FILE *fp; register_temp_file (tmpdir, file_name); - fp = fopen (file_name, "w"); + fp = fopen_temp (file_name, "w"); if (fp == NULL) { error (0, errno, _("failed to create \"%s\""), file_name); @@ -477,7 +480,7 @@ write_temp_file (struct temp_dir *tmpdir, const char *file_name, return true; } fputs (contents, fp); - if (fwriteerror (fp)) + if (fwriteerror_temp (fp)) { error (0, errno, _("error while writing \"%s\" file"), file_name); return true; @@ -570,7 +573,9 @@ is_envjavac_gcj (const char *javac) fclose (fp); goto failed; } - envjavac_gcj = (strstr (line, "gcj") != NULL); + /* It is safe to call c_strstr() instead of strstr() here; see the + comments in c-strstr.h. */ + envjavac_gcj = (c_strstr (line, "gcj") != NULL); fclose (fp);