From 3c381aa734d4176169e7f4b9e7de0ac6694b7999 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 27 Mar 2009 21:49:46 +0000 Subject: [PATCH] * Also handle the __open_2() function, which is needed on x86_64. * Renamed to patch, because these aren't syscalls but Glibc functions. svn path=/nixpkgs/trunk/; revision=14742 --- .../checkinstall/default.nix | 6 +-- ...syscalls.patch => missing-functions.patch} | 38 +++++++++++++++---- 2 files changed, 34 insertions(+), 10 deletions(-) rename pkgs/tools/package-management/checkinstall/{syscalls.patch => missing-functions.patch} (82%) diff --git a/pkgs/tools/package-management/checkinstall/default.nix b/pkgs/tools/package-management/checkinstall/default.nix index 582d11198d67..fe8f20bb456a 100644 --- a/pkgs/tools/package-management/checkinstall/default.nix +++ b/pkgs/tools/package-management/checkinstall/default.nix @@ -17,9 +17,9 @@ stdenv.mkDerivation { # the package.) ./empty-dirs.patch - # Implement the getxattr(), lgetxattr() and __open64_2() - # functions. Needed for doing builds on Ubuntu 8.10. - ./syscalls.patch + # Implement the getxattr(), lgetxattr(), __open_2() and + # __open64_2() functions. Needed for doing builds on Ubuntu 8.10. + ./missing-functions.patch ]; buildInputs = [gettext]; diff --git a/pkgs/tools/package-management/checkinstall/syscalls.patch b/pkgs/tools/package-management/checkinstall/missing-functions.patch similarity index 82% rename from pkgs/tools/package-management/checkinstall/syscalls.patch rename to pkgs/tools/package-management/checkinstall/missing-functions.patch index 01553e8e1b2b..02066134b2ed 100644 --- a/pkgs/tools/package-management/checkinstall/syscalls.patch +++ b/pkgs/tools/package-management/checkinstall/missing-functions.patch @@ -1,6 +1,6 @@ diff -rc checkinstall-orig/installwatch/installwatch.c checkinstall/installwatch/installwatch.c *** checkinstall-orig/installwatch/installwatch.c 2009-03-12 13:40:24.000000000 +0100 ---- checkinstall/installwatch/installwatch.c 2009-03-27 18:38:58.000000000 +0100 +--- checkinstall/installwatch/installwatch.c 2009-03-27 22:42:19.000000000 +0100 *************** *** 110,115 **** --- 110,117 ---- @@ -118,19 +118,43 @@ diff -rc checkinstall-orig/installwatch/installwatch.c checkinstall/installwatch int creat64(const char *pathname, __mode_t mode) { *************** *** 3663,3668 **** ---- 3751,3767 ---- +--- 3751,3791 ---- return result; } ++ int __open_2(const char *pathname, int flags, ...) { ++ va_list ap; ++ mode_t mode; ++ ++ #if DEBUG ++ debug(2,"__open_2(%s,%d,mode)\n",pathname,flags); ++ #endif ++ ++ va_start(ap, flags); ++ mode = va_arg(ap, mode_t); ++ va_end(ap); ++ ++ /* The open() function in Glibc 2.9 is an always-inline ++ function that may call __open_2(), so it's important that ++ we handle it. I don't know what __open_2() is supposed to ++ do, but redirecting it to open() seems to work fine. */ ++ ++ return open(pathname,flags,mode); ++ } ++ + int __open64_2(const char *pathname, int flags, ...) { ++ va_list ap; ++ mode_t mode; ++ + #if DEBUG + debug(2,"__open64_2(%s,%d,mode)\n",pathname,flags); + #endif -+ /* The open() function in Glibc 2.9 is an always-inline -+ function that may call __open64_2, so it's important that -+ we handle it. I don't know what __open64_2 is supposed to -+ do, but redirecting it to open64 seems to work fine. */ -+ return open64(pathname,flags); ++ ++ va_start(ap, flags); ++ mode = va_arg(ap, mode_t); ++ va_end(ap); ++ ++ return open64(pathname,flags,mode); + } + struct dirent64 *readdir64(DIR *dir) {