All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Lyakas <alex.bolshoy.btrfs@gmail.com>
To: Alexander Block <ablock84@googlemail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [RFC PATCH 6/6] Btrfs-progs: add btrfs send/receive commands
Date: Thu, 19 Jul 2012 16:25:59 +0300	[thread overview]
Message-ID: <CAHf9xvaTESntqF_tpKL8CUJGig5vh+Dsh3rH136MpCGCGd1geg@mail.gmail.com> (raw)
In-Reply-To: <CAHf9xvZqQRBZraH4jGu+mRXQFk1aqKaCKMJno=ubypd2rYkicA@mail.gmail.com>

+static int process_link(const char *path, const char *lnk, void *user)
+{
+       int ret;
+       struct btrfs_receive *r = user;
+       char *full_path = path_cat(r->full_subvol_path, path);
+
+       if (g_verbose >= 1)
+               fprintf(stderr, "link %s -> %s\n", path, lnk);
+
+       ret = link(lnk, full_path);
+       if (ret < 0) {
+               ret = -errno;
+               fprintf(stderr, "ERROR: link %s -> %s failed. %s\n", path,
+                               lnk, strerror(-ret));
+       }

Actually it has to be:
char *full_link_path = path_cat(r->full_subvol_path, lnk);
...
ret = link(full_path/*oldpath*/, full_link_path/*newpath*/);
...
free(full_link_path);

Thanks,
Alex.

  reply	other threads:[~2012-07-19 13:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04 13:39 [RFC PATCH 0/6] Experimental btrfs send/receive (btrfs-progs) Alexander Block
2012-07-04 13:39 ` [RFC PATCH 1/6] Btrfs-progs: add BTRFS_IOC_SUBVOL_GET/SETFLAGS to ioctl.h Alexander Block
2012-07-04 13:39 ` [RFC PATCH 2/6] Btrfs-progs: update ioctl.h to support clone range ioctl Alexander Block
2012-07-04 13:39 ` [RFC PATCH 3/6] Btrfs-progs: print inode transid and dir item data field in debug-tree Alexander Block
2012-07-04 13:39 ` [RFC PATCH 4/6] Btrfs-progs: update btrfs-progs for subvol uuid+times support Alexander Block
2012-07-04 13:39 ` [RFC PATCH 5/6] Btrfs-progs: update ioctl.h to support btrfs send ioctl Alexander Block
2012-07-04 13:39 ` [RFC PATCH 6/6] Btrfs-progs: add btrfs send/receive commands Alexander Block
2012-07-09 18:59   ` Alex Lyakas
2012-07-19 13:25     ` Alex Lyakas [this message]
2012-07-24 20:27       ` Alexander Block
2012-07-25  9:15         ` Alex Lyakas
2012-07-27 14:06   ` Arne Jansen
2012-07-04 14:53 ` [RFC PATCH 0/6] Experimental btrfs send/receive (btrfs-progs) Chris Mason
2012-07-23 12:29 ` Arne Jansen
2012-07-25 10:41   ` Alexander Block
2012-07-25 14:00     ` Hugo Mills
2012-07-25 15:17       ` Chris Mason
2012-07-25 16:56       ` Alexander Block
2012-07-25 17:10         ` Alex Lyakas
2012-07-25 17:14           ` Alexander Block

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHf9xvaTESntqF_tpKL8CUJGig5vh+Dsh3rH136MpCGCGd1geg@mail.gmail.com \
    --to=alex.bolshoy.btrfs@gmail.com \
    --cc=ablock84@googlemail.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.