Thread (20 messages) 20 messages, 5 authors, 2012-07-27

Re: [RFC PATCH 6/6] Btrfs-progs: add btrfs send/receive commands

From: Alex Lyakas <hidden>
Date: 2012-07-19 13:26:00

+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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help