Ticket #8857: 0001-Fix-symlinkat-for-Darwin.patch

File 0001-Fix-symlinkat-for-Darwin.patch, 921 bytes (added by nielx, 12 years ago)
  • src/build/libroot/fs_darwin.cpp

    From 98b44ddd825ea797c0fe0e9ce64c4f9ad4febded Mon Sep 17 00:00:00 2001
    From: Niels Sascha Reedijk <niels.reedijk@gmail.com>
    Date: Wed, 8 Aug 2012 23:00:10 +0200
    Subject: [PATCH 1/3] Fix symlinkat for Darwin
    
    ---
     src/build/libroot/fs_darwin.cpp |    7 ++++---
     1 file changed, 4 insertions(+), 3 deletions(-)
    
    diff --git a/src/build/libroot/fs_darwin.cpp b/src/build/libroot/fs_darwin.cpp
    index 89eb244..c4400da 100644
    a b symlinkat(const char *oldPath, int fd, const char *newPath)  
    391391        return -1;
    392392    }
    393393
    394     char oldFullPath[MAXPATHLEN];
    395     if (get_path(fd, oldPath, oldFullPath) < 0)
     394    // newPath is relative to the fd
     395    char newFullPath[MAXPATHLEN];
     396    if (get_path(fd, newPath, newFullPath) < 0)
    396397        return -1;
    397398
    398     return symlink(oldFullPath, newPath);
     399    return symlink(oldPath, newFullPath);
    399400}
    400401
    401402