Add target_ops argument to to_fileio_unlink
authorTom Tromey <tromey@redhat.com>
Wed, 18 Dec 2013 04:39:11 +0000 (21:39 -0700)
committerTom Tromey <tromey@redhat.com>
Wed, 19 Feb 2014 14:46:13 +0000 (07:46 -0700)
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.

gdb/ChangeLog
gdb/inf-child.c
gdb/remote.c
gdb/target.c
gdb/target.h

index fb75b1a6f4d9d25ecc994ead76739327e615afe9..24d3b34dcf13632e143f49c2be5d527a8bd9b779 100644 (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.
index 01bf1af7a63efbf111749c25613869dfba3024e4..eb7550a9c6544b08aeae33ee4547a5c945460080 100644 (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;
 
index 19bef54c1c9c0d9898ec0a1262cc10f67ee8dfc7..cf8870edbf9da0b4b3381b748f7349cd10e6110d 100644 (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);
 
index 8767b572391c5a989909f2793fca2d4ca405fc78..2c4b6b658c3d3078f3382d7bb5618cb8ac960484 100644 (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,
index e2dddc71cf246a75cbf2f722b00a7602d928a9f8..5d5802ef098be80b9e81970bd6f7ebdcddd86406 100644 (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
This page took 0.038582 seconds and 4 git commands to generate.