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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



+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.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux