Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

daemon: Change ln, ln-f (hard-link) APIs to use link(2) instead of ex…

…ternal ln (RHBZ#895905).

The reasons to do this are twofold:

(a) It's probably a tiny bit faster.

(b) It lets us capture the real errno if the link(2) syscall fails.

The errno is also passed through guestmount, fixing RHBZ#895905:

+ guestmount -a test1.img -m /dev/sda1:/ -m /dev/sda2:/boot /tmp/mnt
+ touch /tmp/mnt/foo
+ cd /tmp/mnt
+ ln foo boot/foo
ln: failed to create hard link ‘boot/foo’ => ‘foo’: Invalid cross-device link
  • Loading branch information...
commit 533082e28240522df51e6615d99794d726c8e1f0 1 parent ebc86ae
rwmjones rwmjones authored

Showing 1 changed file with 43 additions and 44 deletions. Show diff stats Hide diff stats

  1. +43 44 daemon/link.c
87 daemon/link.c
@@ -102,13 +102,47 @@ do_internal_readlinklist (const char *path, char *const *names)
@@ -117,36 +151,13 @@ _link (const char *flag, int symbolic, const char *target, const char *linkname)
@@ -157,25 +168,13 @@ _link (const char *flag, int symbolic, const char *target, const char *linkname)

0 comments on commit 533082e

Please sign in to comment.
Something went wrong with that request. Please try again.