ptsname: Avoid ERANGE failure on some systems.
[pspp] / lib / relocatable.c
index 995d3acf856ce0ecd7b48facb89a74fc264d34ca..243248ec57a8edc3b26b887ff2c476f4c9456458 100644 (file)
@@ -1,5 +1,5 @@
 /* Provide relocatable packages.
-   Copyright (C) 2003-2006, 2008-2009 Free Software Foundation, Inc.
+   Copyright (C) 2003-2006, 2008-2010 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify it
@@ -22,7 +22,7 @@
    This must come before <config.h> because <config.h> may include
    <features.h>, and once <features.h> has been included, it's too late.  */
 #ifndef _GNU_SOURCE
-# define _GNU_SOURCE    1
+# define _GNU_SOURCE 1
 #endif
 
 #include <config.h>
@@ -86,6 +86,9 @@
 # define FILE_SYSTEM_PREFIX_LEN(P) 0
 #endif
 
+/* Use the system functions, not the gnulib overrides in this file.  */
+#undef malloc
+
 /* Original installation prefix.  */
 static char *orig_prefix;
 static size_t orig_prefix_len;
@@ -341,8 +344,9 @@ DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
 static void
 find_shared_library_fullname ()
 {
-#if defined __linux__ && __GLIBC__ >= 2
-  /* Linux has /proc/self/maps. glibc 2 has the getline() function.  */
+#if defined __linux__ && (__GLIBC__ >= 2 || defined __UCLIBC__)
+  /* Linux has /proc/self/maps. glibc 2 and uClibc have the getline()
+     function.  */
   FILE *fp;
 
   /* Open the current process' maps file.  It describes one VMA per line.  */