Ticket #49858: patch-libfakeroot.c.diff

File patch-libfakeroot.c.diff, 1.5 KB (added by florian@…, 9 years ago)

files/patch-libfakeroot.c.diff

  • libfakeroot.c

    old new  
    110110#define INT_NEXT_FSTATAT(a,b,c,d) NEXT_FSTATAT(_STAT_VER,a,b,c,d)
    111111#define INT_SEND_STAT(a,b) SEND_STAT(a,b,_STAT_VER)
    112112#define INT_SEND_GET_XATTR(a,b) SEND_GET_XATTR(a,b,_STAT_VER)
     113
     114/* 10.10 uses id_t in getpriority/setpriority calls, so pretend
     115   id_t is used everywhere, just happens to be int on some OSes */
     116#ifndef _ID_T
     117#define _ID_T
     118typedef int id_t;
     119#endif
    113120#endif
    114121
     122#include <sys/types.h>
    115123#include <stdlib.h>
    116124#include <sys/ipc.h>
    117125#include <sys/msg.h>
     
    123131#include <unistd.h>
    124132#include <dirent.h>
    125133#include <errno.h>
    126 #include <sys/types.h>
    127134#ifdef HAVE_SYS_ACL_H
    128135#include <sys/acl.h>
    129136#endif /* HAVE_SYS_ACL_H */
     
    18941901}
    18951902#endif /* HAVE_FREMOVEXATTR */
    18961903
    1897 int setpriority(int which, int who, int prio){
     1904int setpriority(int which, id_t who, int prio){
    18981905  if (fakeroot_disabled)
    18991906    return next_setpriority(which, who, prio);
    19001907  next_setpriority(which, who, prio);
     
    24262433    }
    24272434}
    24282435#endif
     2436
     2437#ifdef HAVE_OPENAT
     2438int openat(int dir_fd, const char *pathname, int flags, ...)
     2439{
     2440    if (flags & O_CREAT)
     2441    {
     2442        va_list args;
     2443        mode_t mode;
     2444        va_start(args, flags);
     2445        mode = va_arg(args, int);
     2446        va_end(args);
     2447        return next_openat(dir_fd, pathname, flags, mode);
     2448    }
     2449    return next_openat(dir_fd, pathname, flags, NULL);
     2450}
     2451#endif