OSDN Git Service

* Makefile.in (build_dumper): Detect missing iconv library.
authorcgf <cgf>
Sat, 21 Feb 2004 04:51:15 +0000 (04:51 +0000)
committercgf <cgf>
Sat, 21 Feb 2004 04:51:15 +0000 (04:51 +0000)
* cygpath.cc (dowin): Report on filename conversion errors.
(doit): Ditto.
* strace.cc (main): Use symbolic constant for _STRACE_ALL when setting mask.

winsup/utils/ChangeLog
winsup/utils/Makefile.in
winsup/utils/cygpath.cc
winsup/utils/strace.cc

index 18910f5..943666c 100644 (file)
@@ -1,3 +1,13 @@
+2004-02-20  Christopher Faylor  <cgf@redhat.com>
+
+       * Makefile.in (build_dumper): Detect missing iconv library.
+
+       * cygpath.cc (dowin): Report on filename conversion errors.
+       (doit): Ditto.
+
+       * strace.cc (main): Use symbolic constant for _STRACE_ALL when setting
+       mask.
+
 2004-02-14  Corinna Vinschen  <corinna@vinschen.de>
 
        * ssp.c (opts): Add leading '+' to force posixly correct behaviour.
index 3a52911..e606989 100644 (file)
@@ -36,9 +36,10 @@ override CXXFLAGS+=-fno-exceptions -fno-rtti -DHAVE_DECL_GETOPT=0
 
 include $(srcdir)/../Makefile.common
 
+LIBICONV:=@libiconv@
 libbfd:=${shell $(CC) -B$(bupdir2)/bfd/ --print-file-name=libbfd.a}
 libintl:=${shell $(CC) -B$(bupdir2)/intl/ --print-file-name=libintl.a}
-build_dumper:=${shell test -r $(libbfd) && test -r ${libintl} &&  echo 1}
+build_dumper:=${shell test -r $(libbfd) -a -r $(libintl) -a -n "$(LIBICONV)" && echo 1}
 
 libz:=${shell x=$$($(CC) -mno-cygwin --print-file-name=libz.a); cd $$(dirname $$x); dir=$$(pwd); case "$$dir" in *mingw*) echo $$dir/libz.a ;; esac}
 zlib_h:=-include ${patsubst %/lib/mingw/libz.a,%/include/zlib.h,${patsubst %/lib/libz.a,%/include/zlib.h,$(libz)}}
@@ -63,7 +64,6 @@ ALL_LDLIBS:=${patsubst $(w32api_lib)/lib%.a,-l%,\
               ${filter-out $(libkernel32),\
                ${filter-out $(libcygwin), $(ALL_DEP_LDLIBS)}}}}
 
-LIBICONV:=@libiconv@
 MINGW_LIB:=$(mingw_build)/libmingw32.a
 DUMPER_LIB:=${libbfd} ${libintl} -L$(bupdir1)/libiberty $(LIBICONV) -liberty
 MINGW_LDLIBS:=${filter-out $(libcygwin),$(ALL_LDLIBS) $(MINGW_LIB)}
index 070b19b..cb64916 100644 (file)
@@ -1,5 +1,5 @@
 /* cygpath.cc -- convert pathnames between Windows and Unix format
-   Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
+   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 Red Hat, Inc.
 
 This file is part of Cygwin.
 
@@ -20,6 +20,7 @@ details. */
 #include <sys/fcntl.h>
 #include <sys/cygwin.h>
 #include <ctype.h>
+#include <errno.h>
 
 static const char version[] = "$Revision$";
 
@@ -391,8 +392,11 @@ dowin (char option)
 
   if (!windows_flag)
     {
-      cygwin_conv_to_posix_path (buf, buf2);
-      buf = buf2;
+      if (cygwin_conv_to_posix_path (buf, buf2))
+       fprintf (stderr, "%s: error converting \"%s\" - %s\n",
+                prog_name, buf, strerror (errno));
+      else
+       buf = buf2;
     }
   else
     {
@@ -410,7 +414,7 @@ doit (char *filename)
 {
   char *buf;
   DWORD len;
-  int retval;
+  int err;
   int (*conv_func) (const char *, char *);
 
   if (!path_flag)
@@ -441,10 +445,12 @@ doit (char *filename)
   if (path_flag)
     {
       if (unix_flag)
-       cygwin_win32_to_posix_path_list (filename, buf);
+       err = cygwin_win32_to_posix_path_list (filename, buf);
       else
        {
-         cygwin_posix_to_win32_path_list (filename, buf);
+         err = cygwin_posix_to_win32_path_list (filename, buf);
+         if (err)
+           /* oops */;
          if (shortname_flag)
            buf = get_short_paths (buf);
          if (longname_flag)
@@ -452,6 +458,12 @@ doit (char *filename)
          if (mixed_flag)
            buf = get_mixed_name (buf);
        }
+      if (err)
+       {
+         fprintf (stderr, "%s: error converting \"%s\" - %s\n",
+                  prog_name, filename, strerror (errno));
+         exit (1);
+       }
     }
   else
     {
@@ -461,13 +473,13 @@ doit (char *filename)
       else
        conv_func = (absolute_flag ? cygwin_conv_to_full_win32_path :
                     cygwin_conv_to_win32_path);
-      retval = conv_func (filename, buf);
+      err = conv_func (filename, buf);
       if (mixed_flag)
        buf = get_mixed_name (buf);
-      if (retval < 0)
+      if (err)
        {
-         fprintf (stderr, "%s: error converting \"%s\"\n",
-                  prog_name, filename);
+         fprintf (stderr, "%s: error converting \"%s\" - %s\n",
+                  prog_name, filename, strerror (errno));
          exit (1);
        }
       if (!unix_flag)
index 633aa55..2d16b69 100644 (file)
@@ -985,7 +985,7 @@ character #%d.\n", optarg, (int) (endptr - optarg), endptr);
     error (0, "must provide a process id to toggle tracing");
 
   if (!mask)
-    mask = 1;
+    mask = _STRACE_ALL;
 
   if (bufsize)
     setvbuf (ofile, (char *) alloca (bufsize), _IOFBF, bufsize);