public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 2/7] Use readlink unconditionally
Date: Wed, 26 Nov 2014 05:46:00 -0000	[thread overview]
Message-ID: <1416980800-21408-3-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1416980800-21408-1-git-send-email-yao@codesourcery.com>

Since readlink module is imported, we can use it unconditionally.
This patch is to remove configure checks and HAVE_READLINK checks in
code.  It was mentioned in the patch below

  [RFA/commit] gdbserver: return ENOSYS if readlink not supported.
  https://sourceware.org/ml/gdb-patches/2012-02/msg00148.html

to use readlink in gdbserver, but we chose something simple at that
moment.

gdb:

2014-11-26  Yao Qi  <yao@codesourcery.com>

	* configure.ac (AC_CHECK_FUNCS): Remove readlink.
	* config.in, configure: Re-generate.
	* inf-child.c (inf_child_fileio_readlink): Don't check
	HAVE_READLINK is defined.

gdb/gdbserver:

2014-11-26  Yao Qi  <yao@codesourcery.com>

	* configure.ac(AC_CHECK_FUNCS): Remove readlink.
	* config.in, configure: Re-generate.
	* hostio.c (handle_unlink): Remove code checking HAVE_READLINK
	is defined.
---
 gdb/config.in              | 3 ---
 gdb/configure              | 2 +-
 gdb/configure.ac           | 2 +-
 gdb/gdbserver/config.in    | 3 ---
 gdb/gdbserver/configure    | 2 +-
 gdb/gdbserver/configure.ac | 2 +-
 gdb/gdbserver/hostio.c     | 4 ----
 gdb/inf-child.c            | 2 +-
 8 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/gdb/config.in b/gdb/config.in
index f1593bd..80b988b 100644
--- a/gdb/config.in
+++ b/gdb/config.in
@@ -330,9 +330,6 @@
 /* Define if Python interpreter is being linked in. */
 #undef HAVE_PYTHON
 
-/* Define to 1 if you have the `readlink' function. */
-#undef HAVE_READLINK
-
 /* Define to 1 if you have the `realpath' function. */
 #undef HAVE_REALPATH
 
diff --git a/gdb/configure b/gdb/configure
index ade1755..e1c0a10 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -10479,7 +10479,7 @@ $as_echo "#define HAVE_WORKING_FORK 1" >>confdefs.h
 fi
 
 for ac_func in canonicalize_file_name realpath getrusage getuid getgid \
-		pipe poll pread pread64 pwrite readlink resize_term \
+		pipe poll pread pread64 pwrite resize_term \
 		sbrk setpgid setpgrp setsid \
 		sigaction sigprocmask sigsetmask socketpair \
 		ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 98eb57b..bcf1ef2 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1305,7 +1305,7 @@ AC_C_BIGENDIAN
 AC_FUNC_MMAP
 AC_FUNC_VFORK
 AC_CHECK_FUNCS([canonicalize_file_name realpath getrusage getuid getgid \
-		pipe poll pread pread64 pwrite readlink resize_term \
+		pipe poll pread pread64 pwrite resize_term \
 		sbrk setpgid setpgrp setsid \
 		sigaction sigprocmask sigsetmask socketpair \
 		ttrace wborder wresize setlocale iconvlist libiconvlist btowc \
diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in
index 8cac205..fd80adc 100644
--- a/gdb/gdbserver/config.in
+++ b/gdb/gdbserver/config.in
@@ -142,9 +142,6 @@
 /* Define to 1 if you have the `pwrite' function. */
 #undef HAVE_PWRITE
 
-/* Define to 1 if you have the `readlink' function. */
-#undef HAVE_READLINK
-
 /* Define to 1 if you have the <sgtty.h> header file. */
 #undef HAVE_SGTTY_H
 
diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure
index 2266617..45838f5 100755
--- a/gdb/gdbserver/configure
+++ b/gdb/gdbserver/configure
@@ -4727,7 +4727,7 @@ fi
 
 done
 
-for ac_func in pread pwrite pread64 readlink
+for ac_func in pread pwrite pread64
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 3864ff4..f59e65b 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -83,7 +83,7 @@ AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl
 		 fcntl.h signal.h sys/file.h dnl
 		 sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl
 		 netinet/tcp.h arpa/inet.h)
-AC_CHECK_FUNCS(pread pwrite pread64 readlink)
+AC_CHECK_FUNCS(pread pwrite pread64)
 
 GDB_AC_COMMON
 
diff --git a/gdb/gdbserver/hostio.c b/gdb/gdbserver/hostio.c
index 1d7a092..8435ecb 100644
--- a/gdb/gdbserver/hostio.c
+++ b/gdb/gdbserver/hostio.c
@@ -478,7 +478,6 @@ handle_unlink (char *own_buf)
 static void
 handle_readlink (char *own_buf, int *new_packet_len)
 {
-#if defined (HAVE_READLINK)
   char filename[HOSTIO_PATH_MAX], linkname[HOSTIO_PATH_MAX];
   char *p;
   int ret, bytes_sent;
@@ -505,9 +504,6 @@ 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 /* ! HAVE_READLINK */
-    sprintf (own_buf, "F-1,%x", FILEIO_ENOSYS);
-#endif
 }
 
 /* Handle all the 'F' file transfer packets.  */
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index 9867ee6..3166c4d 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -412,7 +412,7 @@ inf_child_fileio_readlink (struct target_ops *self,
 {
   /* We support readlink only on systems that also provide a compile-time
      maximum path length (PATH_MAX), at least for now.  */
-#if defined (HAVE_READLINK) && defined (PATH_MAX)
+#if defined (PATH_MAX)
   char buf[PATH_MAX];
   int len;
   char *ret;
-- 
1.9.3

  reply	other threads:[~2014-11-26  5:46 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26  5:46 [PATCH 0/7 V2] Import the rename gnulib module Yao Qi
2014-11-26  5:46 ` Yao Qi [this message]
2014-11-26  5:46 ` [PATCH 1/7] Import readlink Yao Qi
2014-12-03 10:48   ` Joel Brobecker
2014-12-03 12:08     ` [RFA] configure gdb/gnulib with --disable-largefile if largefile support disabled Joel Brobecker
2014-12-03 17:59       ` Eli Zaretskii
2014-12-04  3:18         ` Joel Brobecker
2014-12-04  6:47           ` Eli Zaretskii
2014-12-13 16:29             ` Joel Brobecker
2014-12-04  2:17       ` Yao Qi
2014-12-13 14:46         ` pushed: " Joel Brobecker
2014-11-26  5:47 ` [PATCH 6/7] Use canonicalize_file_name unconditionally Yao Qi
2014-11-27  7:36   ` Joel Brobecker
2014-11-28  3:07     ` Yao Qi
2014-11-28  3:43       ` Joel Brobecker
2014-11-28 10:43         ` Yao Qi
2014-11-28 14:46           ` Joel Brobecker
2014-11-26  5:47 ` [PATCH 4/7] Use lstat unconditionally Yao Qi
2014-11-26  5:47 ` [PATCH 7/7] Import rename module Yao Qi
2014-11-26  5:47 ` [PATCH 3/7] Import lstat Yao Qi
2014-12-02 17:01   ` Joel Brobecker
2014-12-03  9:48     ` [pushed] callback.h:struct host_callback_struct compilation error on Windows hosts Joel Brobecker
2014-12-04  1:09       ` Yao Qi
2014-12-04  5:42         ` Joel Brobecker
2014-11-26  5:47 ` [PATCH 5/7] Import canonicalize-lgpl Yao Qi
2014-11-26 15:40 ` [PATCH 0/7 V2] Import the rename gnulib module Eli Zaretskii
2014-11-27  3:48   ` Yao Qi
2014-11-27  7:41 ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1416980800-21408-3-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).