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.
+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.
+
2014-11-28 Yao Qi <yao@codesourcery.com>
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add readlink.
/* 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
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 \
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 \
+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.
/* 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
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"
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
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;
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. */
{
/* 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;