]> Zhao Yanbai Git Server - minix.git/commitdiff
Simplify (and fix) NBSD libc's weak references of getcwd.
authorGianluca Guida <gianluca@minix3.org>
Tue, 22 Feb 2011 09:08:24 +0000 (09:08 +0000)
committerGianluca Guida <gianluca@minix3.org>
Tue, 22 Feb 2011 09:08:24 +0000 (09:08 +0000)
lib/nbsd_libc/gen/getcwd.c
lib/nbsd_libc/minix-port.patch

index ed12f714d2c265889547a57e3e71ace97a6e8277..75a8bb6a15c4c613c1130e41a42cb25cedc91a10 100644 (file)
@@ -54,8 +54,12 @@ __RCSID("$NetBSD: getcwd.c,v 1.47 2011/01/20 02:57:00 christos Exp $");
 #include "extern.h"
 
 #ifdef __weak_alias
+#ifdef __minix
+__weak_alias(getcwd,_getcwd)
+#else
 __weak_alias(getcwd,_sys_getcwd)
 __weak_alias(_getcwd,_sys_getcwd)
+#endif
 __weak_alias(realpath,_realpath)
 
 #if defined(_FORTIFY_SOURCE) && !defined(__lint__)
index 23360b552503bb79bebcb86c15ce412fc73ceb63..5a5a3b6fb107e1a473d93a60c2a5017adf177bb0 100644 (file)
@@ -457,6 +457,22 @@ diff -ru /home/netbsd/src/lib/libc/gen/fts.c ./gen/fts.c
  
  static FTSENT *fts_alloc(FTS *, const char *, size_t);
  static FTSENT *fts_build(FTS *, int);
+diff -ru /home/netbsd/src/lib/libc/gen/getcwd.c ./gen/getcwd.c
+--- /home/netbsd/src/lib/libc/gen/getcwd.c     2011-01-20 03:02:11.000000000 +0000
++++ ./gen/getcwd.c     2011-02-21 14:27:44.000000000 +0000
+@@ -54,8 +54,12 @@
+ #include "extern.h"
+ #ifdef __weak_alias
++#ifdef __minix
++__weak_alias(getcwd,_getcwd)
++#else
+ __weak_alias(getcwd,_sys_getcwd)
+ __weak_alias(_getcwd,_sys_getcwd)
++#endif
+ __weak_alias(realpath,_realpath)
+ #if defined(_FORTIFY_SOURCE) && !defined(__lint__)
 diff -ru /home/netbsd/src/lib/libc/gen/getgrent.c ./gen/getgrent.c
 --- /home/netbsd/src/lib/libc/gen/getgrent.c   2008-04-28 20:22:59.000000000 +0000
 +++ ./gen/getgrent.c   2011-02-15 10:00:10.000000000 +0000