include sys/stat.h
authorborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 11 Mar 2009 19:44:49 +0000 (19:44 +0000)
committerborutr <borutr@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 11 Mar 2009 19:44:49 +0000 (19:44 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@5410 4a8a32a2-be11-0410-ad9d-d568d2c75423

as/asranlib/asranlib.c

index dde9f787a24beafdac75ff1f1607070418072b89..52dd6111fd59ced3aeef277ebfbe5ac2faffa967 100644 (file)
@@ -21,6 +21,7 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>. */
 #include <string.h>
 #include <assert.h>
 #include <time.h>
+#include <sys/stat.h>
 #include "dbuf_string.h"
 #include "lkar.h"
 
@@ -593,7 +594,6 @@ do_ranlib (const char *archive)
       struct stat stat_buf;
       int can_stat;
 
-      /* TODO: create tmpfile in temporery directory (TMP, TMPDIR, /usr/tmp, /tmp) */
 #ifdef _WIN32
       if (NULL == _mktemp (tmpfile) || NULL == (outfp = fopen (tmpfile, "wb")))
         {
@@ -667,7 +667,7 @@ do_ranlib (const char *archive)
 
       if (0 != fstat(fileno(infp), &stat_buf))
         {
-          fprintf (stderr, "asranlib: can't stat %s: ", infp);
+          fprintf (stderr, "asranlib: can't stat %s: ", archive);
           perror (NULL);
           fclose (infp);
           can_stat = 0;