diff options
author | Joel Brobecker <brobecker@gnat.com> | 2012-02-09 17:29:34 +0000 |
---|---|---|
committer | Joel Brobecker <brobecker@gnat.com> | 2012-02-09 17:29:34 +0000 |
commit | f8255c2a40ccc45f929b4ba2f20b74c52719b1a9 (patch) | |
tree | 8b04bb3ba97de825e37f0aa4b90f8b3a42d5f9da /gdb/gdbserver/hostio.c | |
parent | 1916efaf84a102ab118cda679ab9bf1ba032c993 (diff) | |
download | gdb-f8255c2a40ccc45f929b4ba2f20b74c52719b1a9.zip gdb-f8255c2a40ccc45f929b4ba2f20b74c52719b1a9.tar.gz gdb-f8255c2a40ccc45f929b4ba2f20b74c52719b1a9.tar.bz2 |
[gdbserver] return ENOSYS if readlink not supported.
This reproduces on the GDBserver side what GDB does when readlink is
not supported.
gdb/gdbserver/ChangeLog:
* configure.ac: Add readlink to AC_CHECK_FUNCS list.
* configure, config.in: Regenerate.
* hostio.c: Provide an alternate implementation if HAVE_READLINK
is not defined.
Diffstat (limited to 'gdb/gdbserver/hostio.c')
-rw-r--r-- | gdb/gdbserver/hostio.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/gdbserver/hostio.c b/gdb/gdbserver/hostio.c index 34e4fa8..03aab58 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) char filename[PATH_MAX], linkname[PATH_MAX]; char *p; int ret, bytes_sent; @@ -485,6 +486,9 @@ 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. */ |