From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10853 invoked by alias); 27 Jan 2012 02:02:59 -0000 Received: (qmail 10753 invoked by uid 22791); 27 Jan 2012 02:02:58 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_CP,TW_DB X-Spam-Check-By: sourceware.org Received: from mail-pz0-f41.google.com (HELO mail-pz0-f41.google.com) (209.85.210.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 27 Jan 2012 02:02:44 +0000 Received: by dake40 with SMTP id e40so1081130dak.0 for ; Thu, 26 Jan 2012 18:02:44 -0800 (PST) Received: by 10.68.190.101 with SMTP id gp5mr10282152pbc.31.1327629764233; Thu, 26 Jan 2012 18:02:44 -0800 (PST) Received: from [192.168.1.102] ([115.195.157.214]) by mx.google.com with ESMTPS id li19sm15883826pbb.17.2012.01.26.18.02.41 (version=SSLv3 cipher=OTHER); Thu, 26 Jan 2012 18:02:42 -0800 (PST) Message-ID: <4F2206DE.20907@gmail.com> Date: Fri, 27 Jan 2012 03:20:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: gdb-patches@sourceware.org Subject: fix build error on MinGW (HAVE_READLINK) undefined Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-01/txt/msg00932.txt.bz2 Not sure the patch is correct, but it do build OK now. gdb/gdbserver/hostio.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/gdb/gdbserver/hostio.c b/gdb/gdbserver/hostio.c index 34e4fa8..7575fb1 100644 --- a/gdb/gdbserver/hostio.c +++ b/gdb/gdbserver/hostio.c @@ -459,6 +459,7 @@ handle_unlink (char *own_buf) static void handle_readlink (char *own_buf, int *new_packet_len) { +#if defined (HAVE_READLINK) && defined (PATH_MAX) char filename[PATH_MAX], linkname[PATH_MAX]; char *p; int ret, bytes_sent; @@ -485,6 +486,10 @@ handle_readlink (char *own_buf, int *new_packet_len) to return a partial response, but simply fail. */ if (bytes_sent < ret) sprintf (own_buf, "F-1,%x", FILEIO_ENAMETOOLONG); +#else + hostio_error (own_buf); + return; +#endif } /* Handle all the 'F' file transfer packets. */ The other question is: Here it use : PATH_MAX, but some other place, it use MAXPATHLEN see: inf-child.c /* Read value of symbolic link FILENAME on the target. Return a null-terminated string allocated via xmalloc, or NULL if an error occurs (and set *TARGET_ERRNO). */ static char * inf_child_fileio_readlink (const char *filename, int *target_errno) { /* We support readlink only on systems that also provide a compile-time maximum path length (MAXPATHLEN), at least for now. */ #if defined (HAVE_READLINK) && defined (MAXPATHLEN) char buf[MAXPATHLEN]; int len; char *ret; len = readlink (filename, buf, sizeof buf); if (len < 0) { *target_errno = inf_child_errno_to_fileio_error (errno); return NULL; } ret = xmalloc (len + 1); memcpy (ret, buf, len); ret[len] = '\0'; return ret; #else *target_errno = FILEIO_ENOSYS; return NULL; #endif } asmwarrior ollydbg from codeblocks' forum