Add target_ops argument to to_fileio_unlink

2014-02-19  Tom Tromey  <tromey@redhat.com>

	* target.h (struct target_ops) <to_fileio_unlink>: Add argument.
	* target.c (target_fileio_unlink): Add argument.
	* remote.c (remote_hostio_unlink): Add 'self' argument.
	(remote_file_delete): Update.
	* inf-child.c (inf_child_fileio_unlink): Add 'self' argument.
This commit is contained in:
Tom Tromey 2013-12-17 21:39:11 -07:00
parent df39ea259c
commit dbbca37d38
5 changed files with 17 additions and 5 deletions

View file

@ -1,3 +1,11 @@
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_fileio_unlink>: Add argument.
* target.c (target_fileio_unlink): Add argument.
* remote.c (remote_hostio_unlink): Add 'self' argument.
(remote_file_delete): Update.
* inf-child.c (inf_child_fileio_unlink): Add 'self' argument.
2014-02-19 Tom Tromey <tromey@redhat.com>
* target.h (struct target_ops) <to_fileio_close>: Add argument.

View file

@ -328,7 +328,8 @@ inf_child_fileio_close (struct target_ops *self, int fd, int *target_errno)
/* Unlink FILENAME on the target. Return 0, or -1 if an error
occurs (and set *TARGET_ERRNO). */
static int
inf_child_fileio_unlink (const char *filename, int *target_errno)
inf_child_fileio_unlink (struct target_ops *self,
const char *filename, int *target_errno)
{
int ret;

View file

@ -9770,7 +9770,8 @@ remote_hostio_close (struct target_ops *self, int fd, int *remote_errno)
occurs (and set *REMOTE_ERRNO). */
static int
remote_hostio_unlink (const char *filename, int *remote_errno)
remote_hostio_unlink (struct target_ops *self,
const char *filename, int *remote_errno)
{
struct remote_state *rs = get_remote_state ();
char *p = rs->buf;
@ -10152,7 +10153,8 @@ remote_file_delete (const char *remote_file, int from_tty)
if (!rs->remote_desc)
error (_("command can only be used with remote target"));
retcode = remote_hostio_unlink (remote_file, &remote_errno);
retcode = remote_hostio_unlink (find_target_at (process_stratum),
remote_file, &remote_errno);
if (retcode == -1)
remote_hostio_error (remote_errno);

View file

@ -3483,7 +3483,7 @@ target_fileio_unlink (const char *filename, int *target_errno)
{
if (t->to_fileio_unlink != NULL)
{
int ret = t->to_fileio_unlink (filename, target_errno);
int ret = t->to_fileio_unlink (t, filename, target_errno);
if (targetdebug)
fprintf_unfiltered (gdb_stdlog,

View file

@ -740,7 +740,8 @@ struct target_ops
/* Unlink FILENAME on the target. Return 0, or -1 if an error
occurs (and set *TARGET_ERRNO). */
int (*to_fileio_unlink) (const char *filename, int *target_errno);
int (*to_fileio_unlink) (struct target_ops *,
const char *filename, int *target_errno);
/* Read value of symbolic link FILENAME on the target. Return a
null-terminated string allocated via xmalloc, or NULL if an error