components/coreutils/patches/stdbuf.c.patch
author Rich Burridge <rich.burridge@oracle.com>
Thu, 15 May 2014 16:58:20 -0700
changeset 1898 5c902a3c6e7e
parent 1895 1f133713df64
child 2050 7c6a1559c620
permissions -rw-r--r--
18744156 /usr/gnu/bin/chroot is killed when executed with an invalid command argument
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1895
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
     1
Change needed to get stdbuf to successfully preload libstdbuf.so
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
     2
for both 32-bit and 64-bit applications.
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
     3
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
     4
This change has been passed upstream.
1465
26be70b523fc 17408935 GNU coreutils should be 64-bit
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     5
1895
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
     6
--- coreutils-8.16/src/stdbuf.c.orig	2014-05-12 13:48:24.644347899 -0700
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
     7
+++ coreutils-8.16/src/stdbuf.c	2014-05-14 09:45:52.507614923 -0700
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
     8
@@ -200,6 +200,14 @@
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
     9
   char const *const search_path[] = {
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    10
     program_path,
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    11
     PKGLIBEXECDIR,
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    12
+
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    13
+   /* Since we don't link against libstdbuf.so, we need to LD_PRELOAD it.
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    14
+      libstdbuf.so lives in /usr/lib and /usr/lib/64, so we just use a
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    15
+      search path value of "" and that equates to LD_PRELOAD=libstdbuf.so,
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    16
+      and ld.so.1 finds the right one associated with the process class.
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    17
+      ie. we don't use full path names for the preload names.  */
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    18
+
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    19
+    "",              /* System default */
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    20
     NULL
1f133713df64 15941179 coreutils "gmake test" failures
Rich Burridge <rich.burridge@oracle.com>
parents: 1465
diff changeset
    21
   };
1465
26be70b523fc 17408935 GNU coreutils should be 64-bit
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    22