aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2014-11-04 22:17:02 +0800
committerYao Qi <yao@codesourcery.com>2014-11-28 18:37:52 +0800
commitbdca27a2f57f5152ec83766d7a8b25b2d33b8905 (patch)
treeef9071bec4fb43dbce216e92fee033b7754e7dda /gdb/gdbserver
parent2196f55f0140f3e278ed4002040f32acc5a6aaf1 (diff)
downloadgdb-bdca27a2f57f5152ec83766d7a8b25b2d33b8905.zip
gdb-bdca27a2f57f5152ec83766d7a8b25b2d33b8905.tar.gz
gdb-bdca27a2f57f5152ec83766d7a8b25b2d33b8905.tar.bz2
Use readlink unconditionally
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-28 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-28 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.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog7
-rw-r--r--gdb/gdbserver/config.in3
-rwxr-xr-xgdb/gdbserver/configure2
-rw-r--r--gdb/gdbserver/configure.ac2
-rw-r--r--gdb/gdbserver/hostio.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 1419470..e378a5f 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,10 @@
+2014-11-28 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.
+
2014-11-21 Yao Qi <yao@codesourcery.com>
* configure.ac: Don't invoke AC_FUNC_ALLOCA.
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. */