]> sourceware.org Git - newlib-cygwin.git/commitdiff
* dcrt0.cc (initial_env): Use PATH_MAX instead of CYG_MAX_PATH for path
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 6 Dec 2007 18:24:06 +0000 (18:24 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 6 Dec 2007 18:24:06 +0000 (18:24 +0000)
name buffer size.
(dll_crt0_1): Allocate new_argv0 with PATH_MAX size.
* exceptions.cc (debugger_command): Set size to 2 * PATH_MAX + 20;
(error_start_init): Use PATH_MAX instead of CYG_MAX_PATH for path
name buffer size.
* external.cc (fillout_pinfo): Always fill out ep.progname 0-terminated.
Fill out ep.progname_long.
* fhandler_process.cc (fhandler_process::fill_filebuf): Allocate
buffer for executable filename with PATH_MAX size.
* pinfo.cc: Throughout use PATH_MAX instead of CYG_MAX_PATH.
* pinfo.h (class _pinfo): Set progname size to PATH_MAX.
* smallprint.cc: Include limits.h.  Use PATH_MAX instead of CYG_MAX_PATH
for path name buffer size.
* strace.cc (strace::vsprntf): Ditto.
* include/sys/cygwin.h (EXTERNAL_PINFO_VERSION_32_LP): Define.
(EXTERNAL_PINFO_VERSION): Set to EXTERNAL_PINFO_VERSION_32_LP.
(struct external_pinfo): Add progname_long member.
* include/sys/dirent.h: Correctly include limits.h instead of
sys/limits.h.

winsup/cygwin/ChangeLog
winsup/cygwin/dcrt0.cc
winsup/cygwin/exceptions.cc
winsup/cygwin/external.cc
winsup/cygwin/fhandler_process.cc
winsup/cygwin/include/sys/cygwin.h
winsup/cygwin/include/sys/dirent.h
winsup/cygwin/pinfo.cc
winsup/cygwin/pinfo.h
winsup/cygwin/smallprint.cc
winsup/cygwin/strace.cc

index d35588ac623fb8145d74e47f70d74ab44f761a5c..dc24516a3c64b4951463b2b2dc57e1b43a3e5f17 100644 (file)
@@ -1,3 +1,26 @@
+2007-12-06  Corinna Vinschen  <corinna@vinschen.de>
+
+       * dcrt0.cc (initial_env): Use PATH_MAX instead of CYG_MAX_PATH for path
+       name buffer size.
+       (dll_crt0_1): Allocate new_argv0 with PATH_MAX size.
+       * exceptions.cc (debugger_command): Set size to 2 * PATH_MAX + 20;
+       (error_start_init): Use PATH_MAX instead of CYG_MAX_PATH for path
+       name buffer size.
+       * external.cc (fillout_pinfo): Always fill out ep.progname 0-terminated.
+       Fill out ep.progname_long.
+       * fhandler_process.cc (fhandler_process::fill_filebuf): Allocate
+       buffer for executable filename with PATH_MAX size.
+       * pinfo.cc: Throughout use PATH_MAX instead of CYG_MAX_PATH.
+       * pinfo.h (class _pinfo): Set progname size to PATH_MAX.
+       * smallprint.cc: Include limits.h.  Use PATH_MAX instead of CYG_MAX_PATH
+       for path name buffer size.
+       * strace.cc (strace::vsprntf): Ditto.
+       * include/sys/cygwin.h (EXTERNAL_PINFO_VERSION_32_LP): Define.
+       (EXTERNAL_PINFO_VERSION): Set to EXTERNAL_PINFO_VERSION_32_LP.
+       (struct external_pinfo): Add progname_long member.
+       * include/sys/dirent.h: Correctly include limits.h instead of
+       sys/limits.h.
+
 2007-12-05  Corinna Vinschen  <corinna@vinschen.de>
 
        * fhandler_tty.cc (fhandler_tty_slave::open): Use MAX_PATH instead of
index bb4a2c1d568e6091dcbddba842661befa5cfc655..ca4331cf84487856133e98c0a179aa7938b460f6 100644 (file)
@@ -542,7 +542,7 @@ break_here ()
 static void
 initial_env ()
 {
-  char buf[CYG_MAX_PATH];
+  char buf[PATH_MAX];
   if (GetEnvironmentVariable ("CYGWIN_TESTING", buf, sizeof (buf) - 1))
     _cygwin_testing = 1;
 
@@ -553,7 +553,7 @@ initial_env ()
     {
       DWORD ms = atoi (buf);
       buf[0] = '\0';
-      len = GetModuleFileName (NULL, buf, CYG_MAX_PATH);
+      len = GetModuleFileName (NULL, buf, PATH_MAX);
       console_printf ("Sleeping %d, pid %u %s\n", ms, GetCurrentProcessId (), buf);
       Sleep (ms);
       if (!strace.active () && !dynamically_loaded)
@@ -561,8 +561,8 @@ initial_env ()
     }
   if (GetEnvironmentVariable ("CYGWIN_DEBUG", buf, sizeof (buf) - 1))
     {
-      char buf1[CYG_MAX_PATH];
-      len = GetModuleFileName (NULL, buf1, CYG_MAX_PATH);
+      char buf1[PATH_MAX];
+      len = GetModuleFileName (NULL, buf1, PATH_MAX);
       strlwr (buf1);
       strlwr (buf);
       char *p = strpbrk (buf, ":=");
@@ -871,7 +871,7 @@ dll_crt0_1 (void *)
         win32 style. */
       if ((strchr (__argv[0], ':')) || (strchr (__argv[0], '\\')))
        {
-         char *new_argv0 = (char *) malloc (CYG_MAX_PATH);
+         char *new_argv0 = (char *) malloc (PATH_MAX);
          cygwin_conv_to_posix_path (__argv[0], new_argv0);
          __argv[0] = (char *) realloc (new_argv0, strlen (new_argv0) + 1);
        }
index e3569ce2331187c426753eda9ede1bfe5440786d..d030f130d313575268cd8d4f347e6b0ffa83fec1 100644 (file)
@@ -35,7 +35,7 @@ details. */
 
 #define CALL_HANDLER_RETRY 20
 
-char debugger_command[2 * CYG_MAX_PATH + 20];
+char debugger_command[2 * PATH_MAX + 20];
 
 extern "C" {
 extern void sigdelayed ();
@@ -118,8 +118,8 @@ error_start_init (const char *buf)
       return;
     }
 
-  char pgm[CYG_MAX_PATH];
-  if (!GetModuleFileName (NULL, pgm, CYG_MAX_PATH))
+  char pgm[PATH_MAX];
+  if (!GetModuleFileName (NULL, pgm, PATH_MAX))
     strcpy (pgm, "cygwin1.dll");
   for (char *p = strchr (pgm, '\\'); p; p = strchr (p, '\\'))
     *p = '/';
index ea7ae114eb080100acca544949e11667654d460c..cc080d2d2dd0d31d367b0deab91b2bcc612e8458 100644 (file)
@@ -88,7 +88,8 @@ fillout_pinfo (pid_t pid, int winpid)
          ep.start_time = p->start_time;
          ep.rusage_self = p->rusage_self;
          ep.rusage_children = p->rusage_children;
-         strcpy (ep.progname, p->progname);
+         ep.progname[0] = '\0';
+         strncat (ep.progname, p->progname, MAX_PATH - 1);
          ep.strace_mask = 0;
          ep.version = EXTERNAL_PINFO_VERSION;
 
@@ -96,6 +97,8 @@ fillout_pinfo (pid_t pid, int winpid)
 
          ep.uid32 = p->uid;
          ep.gid32 = p->gid;
+
+         strcpy (ep.progname_long, p->progname);
          break;
        }
     }
index 916c0dbf3e15f847313227429337bfa7290ae702..8f9c9bd0407d85a384380e4578bdd8c408875e88 100644 (file)
@@ -442,7 +442,7 @@ fhandler_process::fill_filebuf ()
     case PROCESS_EXENAME:
     case PROCESS_EXE:
       {
-       filebuf = (char *) crealloc_abort (filebuf, bufalloc = CYG_MAX_PATH);
+       filebuf = (char *) crealloc_abort (filebuf, bufalloc = PATH_MAX);
        if (p->process_state & PID_EXITED)
          strcpy (filebuf, "<defunct>");
        else
index 7fe4a137779bff674f72f8e127c8fc8178243da6..80d31cd3966124f8eb76b49244c81c83f5e8cfba 100644 (file)
@@ -226,7 +226,8 @@ extern int cygwin_attach_handle_to_fd (char *, int, HANDLE, mode_t, DWORD);
 
 #define EXTERNAL_PINFO_VERSION_16_BIT 0
 #define EXTERNAL_PINFO_VERSION_32_BIT 1
-#define EXTERNAL_PINFO_VERSION EXTERNAL_PINFO_VERSION_32_BIT
+#define EXTERNAL_PINFO_VERSION_32_LP  2
+#define EXTERNAL_PINFO_VERSION EXTERNAL_PINFO_VERSION_32_LP
 
 #ifndef _SYS_TYPES_H
 typedef unsigned short __uid16_t;
@@ -262,6 +263,9 @@ struct external_pinfo
   /* Only available if version >= EXTERNAL_PINFO_VERSION_32_BIT */
   __uid32_t uid32;
   __gid32_t gid32;
+
+  /* Only available if version >= EXTERNAL_PINFO_VERSION_32_LP */
+  char progname_long[PATH_MAX];
 };
 #endif /*__CYGWIN__*/
 #endif /*WINVER*/
index e62cd924929b254a7c79673eda07c42635bdddbf..41bfcc11db0ec2ecda7bc1e4abc84467aab95ad9 100644 (file)
@@ -12,7 +12,7 @@
 #define _SYS_DIRENT_H
 
 #include <sys/types.h>
-#include <sys/limits.h>
+#include <limits.h>
 
 #define __DIRENT_VERSION       2
 
index b7d8a6decf7b260cb522ed92bb5df920a2ff3648..d1565f80dbfa5818ec7c4cf4da995f17a854392e 100644 (file)
@@ -392,7 +392,7 @@ DWORD WINAPI
 commune_process (void *arg)
 {
   siginfo_t& si = *((siginfo_t *) arg);
-  char path[CYG_MAX_PATH];
+  char path[PATH_MAX];
   DWORD nr;
   HANDLE& tothem = si._si_commune._si_write_handle;
   HANDLE process_sync =
@@ -439,8 +439,7 @@ commune_process (void *arg)
     case PICOM_CWD:
       {
        sigproc_printf ("processing PICOM_CWD");
-       unsigned int n = strlen (cygheap->cwd.get (path, 1, 1,
-                                                  CYG_MAX_PATH)) + 1;
+       unsigned int n = strlen (cygheap->cwd.get (path, 1, 1, PATH_MAX)) + 1;
        if (!WriteFile (tothem, &n, sizeof n, &nr, NULL))
          sigproc_printf ("WriteFile sizeof cwd failed, %E");
        else if (!WriteFile (tothem, path, n, &nr, NULL))
@@ -571,7 +570,7 @@ _pinfo::commune_request (__uint32_t code, ...)
     }
 
   locked = true;
-  char name_buf[CYG_MAX_PATH];
+  char name_buf[MAX_PATH];
   request_sync = CreateSemaphore (&sec_none_nih, 0, LONG_MAX,
                                  shared_name (name_buf, "commune", myself->pid));
   if (!request_sync)
@@ -666,7 +665,7 @@ _pinfo::fd (int fd, size_t &n)
       if (cfd < 0)
        s = cstrdup ("");
       else
-       s = cfd->get_proc_fd_name ((char *) cmalloc_abort (HEAP_COMMUNE, CYG_MAX_PATH));
+       s = cfd->get_proc_fd_name ((char *) cmalloc_abort (HEAP_COMMUNE, PATH_MAX));
       n = strlen (s) + 1;
     }
   return s;
@@ -737,8 +736,8 @@ _pinfo::cwd (size_t& n)
     }
   else
     {
-      s = (char *) cmalloc_abort (HEAP_COMMUNE, CYG_MAX_PATH);
-      cygheap->cwd.get (s, 1, 1, CYG_MAX_PATH);
+      s = (char *) cmalloc_abort (HEAP_COMMUNE, PATH_MAX);
+      cygheap->cwd.get (s, 1, 1, PATH_MAX);
       n = strlen (s) + 1;
     }
   return s;
index b6b46e6b8fba356f257b996da753180757d37671..3c5e100fbee2470734360ab0eb5b7975e5778cc9 100644 (file)
@@ -64,7 +64,7 @@ public:
   DWORD dwProcessId;
 
   /* Used to spawn a child for fork(), among other things. */
-  char progname[CYG_MAX_PATH];
+  char progname[PATH_MAX];
 
   /* User information.
      The information is derived from the GetUserName system call,
index bdf50288bcd5e98cfcc576b125902f7b4427af23..9208947e2ddd26b7496b5be62f9559135f982adf 100644 (file)
@@ -13,6 +13,7 @@ details. */
 #include <stdarg.h>
 #include <stdlib.h>
 #include <ctype.h>
+#include <limits.h>
 
 #define LLMASK (0xffffffffffffffffULL)
 #define LMASK  (0xffffffff)
@@ -63,7 +64,7 @@ __rn (char *dst, int base, int dosign, long long val, int len, int pad, unsigned
 extern "C" int
 __small_vsprintf (char *dst, const char *fmt, va_list ap)
 {
-  char tmp[CYG_MAX_PATH + 1];
+  char tmp[PATH_MAX];
   char *orig = dst;
   const char *s;
   PWCHAR w;
@@ -168,7 +169,7 @@ __small_vsprintf (char *dst, const char *fmt, va_list ap)
                  dst = rnargLL (dst, 16, 0, len, pad);
                  break;
                case 'P':
-                 if (!GetModuleFileName (NULL, tmp, CYG_MAX_PATH))
+                 if (!GetModuleFileName (NULL, tmp, PATH_MAX))
                    s = "cygwin program";
                  else
                    s = tmp;
index 8c778937e81ece8c608953ce9f90922ac6e08b74..c29a8de2d34593608b2592521a1785cbec779c97 100644 (file)
@@ -154,7 +154,7 @@ strace::vsprntf (char *buf, const char *func, const char *infmt, va_list ap)
        pn = NULL;
 
       char *p;
-      char progname[CYG_MAX_PATH];
+      char progname[PATH_MAX];
       if (!pn)
        GetModuleFileName (NULL, pn = progname, sizeof (progname));
       if (!pn)
This page took 0.066399 seconds and 5 git commands to generate.