summaryrefslogtreecommitdiff
path: root/core/glibc/glibc-2.15-fmtmsg-locking.patch
diff options
context:
space:
mode:
authorMichał Masłowski <mtjm@mtjm.eu>2012-03-07 18:10:48 +0100
committerMichał Masłowski <mtjm@mtjm.eu>2012-03-07 18:10:48 +0100
commit61733e7ff1a756e9325154d9d52cdcdeb27d9097 (patch)
treea0f842807088c4986fb918be0de70bac3f18ea04 /core/glibc/glibc-2.15-fmtmsg-locking.patch
parent42badd081241c57a3b9bbd7a18dec85e64038314 (diff)
parent5a680f7689b01b4b7a0bfade1a6c1f659f8cbed4 (diff)
Merge branch 'master' of ssh://parabolagnulinux.org:1863/home/parabola/abslibre-pre-mips64el
Conflicts: community/bin2iso/PKGBUILD community/espeak/PKGBUILD community/gnash/PKGBUILD community/gtk2hs-buildtools/PKGBUILD community/haskell-binary/PKGBUILD community/haskell-dataenc/PKGBUILD community/haskell-ghc-paths/PKGBUILD community/haskell-haskeline/PKGBUILD community/haskell-hslogger/PKGBUILD community/haskell-tar/PKGBUILD community/haskell-terminfo/PKGBUILD community/haskell-utf8-string/PKGBUILD community/haskell-x11-xft/PKGBUILD community/kmess/PKGBUILD community/libident/PKGBUILD community/lwm/PKGBUILD core/dialog/PKGBUILD core/gcc/PKGBUILD core/libtool/PKGBUILD core/ppl/PKGBUILD extra/boost/PKGBUILD extra/dnsmasq/PKGBUILD extra/ghc/PKGBUILD extra/haskell-html/PKGBUILD extra/haskell-http/PKGBUILD extra/haskell-mtl/PKGBUILD extra/haskell-network/PKGBUILD extra/haskell-parsec/PKGBUILD extra/haskell-quickcheck/PKGBUILD extra/haskell-regex-base/PKGBUILD extra/haskell-regex-compat/PKGBUILD extra/haskell-regex-posix/PKGBUILD extra/haskell-text/PKGBUILD extra/haskell-transformers/PKGBUILD extra/haskell-zlib/PKGBUILD extra/liborigin2/PKGBUILD extra/libpst/PKGBUILD extra/mkvtoolnix/PKGBUILD extra/pekwm/PKGBUILD extra/soprano/PKGBUILD extra/udisks/PKGBUILD multilib-testing/lib32-libpciaccess/PKGBUILD multilib/gcc-multilib/PKGBUILD multilib/lib32-glibc/PKGBUILD multilib/lib32-glibc/glibc-2.12.2-ignore-origin-of-privileged-program.patch multilib/lib32-glibc/glibc-2.15-ifunc.patch multilib/lib32-glibc/glibc-2.15-revert-netlink-cache.patch multilib/lib32-glibc/glibc-2.15-scanf.patch multilib/libtool-multilib/PKGBUILD staging/kdeedu-kig/PKGBUILD staging/kdeedu-rocs/PKGBUILD testing/libpciaccess/PKGBUILD testing/mkinitcpio-busybox/PKGBUILD testing/xorg-server/PKGBUILD
Diffstat (limited to 'core/glibc/glibc-2.15-fmtmsg-locking.patch')
-rw-r--r--core/glibc/glibc-2.15-fmtmsg-locking.patch148
1 files changed, 148 insertions, 0 deletions
diff --git a/core/glibc/glibc-2.15-fmtmsg-locking.patch b/core/glibc/glibc-2.15-fmtmsg-locking.patch
new file mode 100644
index 000000000..f5976abd9
--- /dev/null
+++ b/core/glibc/glibc-2.15-fmtmsg-locking.patch
@@ -0,0 +1,148 @@
+diff --git a/stdlib/fmtmsg.c b/stdlib/fmtmsg.c
+index 9203317..4c02302 100644
+--- a/stdlib/fmtmsg.c
++++ b/stdlib/fmtmsg.c
+@@ -103,7 +103,6 @@ fmtmsg (long int classification, const char *label, int severity,
+ const char *text, const char *action, const char *tag)
+ {
+ __libc_once_define (static, once);
+- int result = MM_OK;
+ struct severity_info *severity_rec;
+
+ /* Make sure everything is initialized. */
+@@ -124,17 +123,6 @@ fmtmsg (long int classification, const char *label, int severity,
+ return MM_NOTOK;
+ }
+
+- for (severity_rec = severity_list; severity_rec != NULL;
+- severity_rec = severity_rec->next)
+- if (severity == severity_rec->severity)
+- /* Bingo. */
+- break;
+-
+- /* If we don't know anything about the severity level return an error. */
+- if (severity_rec == NULL)
+- return MM_NOTOK;
+-
+-
+ #ifdef __libc_ptf_call
+ /* We do not want this call to be cut short by a thread
+ cancellation. Therefore disable cancellation for now. */
+@@ -143,54 +131,73 @@ fmtmsg (long int classification, const char *label, int severity,
+ 0);
+ #endif
+
+- /* Now we can print. */
+- if (classification & MM_PRINT)
+- {
+- int do_label = (print & label_mask) && label != MM_NULLLBL;
+- int do_severity = (print & severity_mask) && severity != MM_NULLSEV;
+- int do_text = (print & text_mask) && text != MM_NULLTXT;
+- int do_action = (print & action_mask) && action != MM_NULLACT;
+- int do_tag = (print & tag_mask) && tag != MM_NULLTAG;
+-
+- if (__fxprintf (stderr, "%s%s%s%s%s%s%s%s%s%s\n",
+- do_label ? label : "",
+- do_label && (do_severity | do_text | do_action | do_tag)
+- ? ": " : "",
+- do_severity ? severity_rec->string : "",
+- do_severity && (do_text | do_action | do_tag)
+- ? ": " : "",
+- do_text ? text : "",
+- do_text && (do_action | do_tag) ? "\n" : "",
+- do_action ? "TO FIX: " : "",
+- do_action ? action : "",
+- do_action && do_tag ? " " : "",
+- do_tag ? tag : "") < 0)
+- /* Oh, oh. An error occurred during the output. */
+- result = MM_NOMSG;
+- }
++ __libc_lock_lock (lock);
+
+- if (classification & MM_CONSOLE)
++ for (severity_rec = severity_list; severity_rec != NULL;
++ severity_rec = severity_rec->next)
++ if (severity == severity_rec->severity)
++ /* Bingo. */
++ break;
++
++ /* If we don't know anything about the severity level return an error. */
++ int result = MM_NOTOK;
++ if (severity_rec != NULL)
+ {
+- int do_label = label != MM_NULLLBL;
+- int do_severity = severity != MM_NULLSEV;
+- int do_text = text != MM_NULLTXT;
+- int do_action = action != MM_NULLACT;
+- int do_tag = tag != MM_NULLTAG;
+-
+- syslog (LOG_ERR, "%s%s%s%s%s%s%s%s%s%s\n",
+- do_label ? label : "",
+- do_label && (do_severity | do_text | do_action | do_tag)
+- ? ": " : "",
+- do_severity ? severity_rec->string : "",
+- do_severity && (do_text | do_action | do_tag) ? ": " : "",
+- do_text ? text : "",
+- do_text && (do_action | do_tag) ? "\n" : "",
+- do_action ? "TO FIX: " : "",
+- do_action ? action : "",
+- do_action && do_tag ? " " : "",
+- do_tag ? tag : "");
++ result = MM_OK;
++
++ /* Now we can print. */
++ if (classification & MM_PRINT)
++ {
++ int do_label = (print & label_mask) && label != MM_NULLLBL;
++ int do_severity = (print & severity_mask) && severity != MM_NULLSEV;
++ int do_text = (print & text_mask) && text != MM_NULLTXT;
++ int do_action = (print & action_mask) && action != MM_NULLACT;
++ int do_tag = (print & tag_mask) && tag != MM_NULLTAG;
++ int need_colon = (do_label
++ && (do_severity | do_text | do_action | do_tag));
++
++ if (__fxprintf (stderr, "%s%s%s%s%s%s%s%s%s%s\n",
++ do_label ? label : "",
++ need_colon ? ": " : "",
++ do_severity ? severity_rec->string : "",
++ do_severity && (do_text | do_action | do_tag)
++ ? ": " : "",
++ do_text ? text : "",
++ do_text && (do_action | do_tag) ? "\n" : "",
++ do_action ? "TO FIX: " : "",
++ do_action ? action : "",
++ do_action && do_tag ? " " : "",
++ do_tag ? tag : "") < 0)
++ /* Oh, oh. An error occurred during the output. */
++ result = MM_NOMSG;
++ }
++
++ if (classification & MM_CONSOLE)
++ {
++ int do_label = label != MM_NULLLBL;
++ int do_severity = severity != MM_NULLSEV;
++ int do_text = text != MM_NULLTXT;
++ int do_action = action != MM_NULLACT;
++ int do_tag = tag != MM_NULLTAG;
++ int need_colon = (do_label
++ && (do_severity | do_text | do_action | do_tag));
++
++ syslog (LOG_ERR, "%s%s%s%s%s%s%s%s%s%s\n",
++ do_label ? label : "",
++ need_colon ? ": " : "",
++ do_severity ? severity_rec->string : "",
++ do_severity && (do_text | do_action | do_tag) ? ": " : "",
++ do_text ? text : "",
++ do_text && (do_action | do_tag) ? "\n" : "",
++ do_action ? "TO FIX: " : "",
++ do_action ? action : "",
++ do_action && do_tag ? " " : "",
++ do_tag ? tag : "");
++ }
+ }
+
++ __libc_lock_unlock (lock);
++
+ #ifdef __libc_ptf_call
+ __libc_ptf_call (pthread_setcancelstate, (state, NULL), 0);
+ #endif