git.iko.soy/typeable/nixpkgs
on master help sign in
libredirect: Add preload wrapper for stat()

Pull request #50246 was merged a bit too quickly and it was supposed to fix libredirect on Darwin. However it still failed on Darwin and this was missed by the person merging the pull request. The reason this was failing was that there is no __xstat* on Darwin. So I'm adding a wrapper for stat() as well as it works on Darwin and it still doesn't hurt on GNU/Linux. Signed-off-by: aszlig <aszlig@nix.build> Cc: @edolstra, @zimbatm

commita815f53c60b95716309bd711cbc9bf6de4050bcd authoraszlig <aszlig@nix.build> dateMon 12 Nov 2018, 13:08 (8 years ago) parent22a8025
1 file changed+7
pkgs/build-support/libredirect/libredirect.c+7
pkgs/build-support/libredirect/libredirect.c+7
@@ -119,6 +119,13 @@ int __xstat64(int ver, const char * path, struct stat64 * st)
119119 return __xstat64_real(ver, rewrite(path, buf), st);
120120}
121121
122+int stat(const char * path, struct stat * st)
123+{
124+ int (*__stat_real) (const char *, struct stat *) = dlsym(RTLD_NEXT, "stat");
125+ char buf[PATH_MAX];
126+ return __stat_real(rewrite(path, buf), st);
127+}
128+
122129int * access(const char * path, int mode)
123130{
124131 int * (*access_real) (const char *, int mode) = dlsym(RTLD_NEXT, "access");