From: Ben Pfaff Date: Wed, 10 Jun 2009 23:45:02 +0000 (-0700) Subject: Add file missing from commit baf099 "Fix glibc 2.7 strtok_r() bug...". X-Git-Tag: v0.90.1~17 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=8d3a769e1cc6e850b882156d4bbdea68e2110877;p=sliver-openvswitch.git Add file missing from commit baf099 "Fix glibc 2.7 strtok_r() bug...". Oops. --- diff --git a/lib/string.h b/lib/string.h new file mode 100644 index 000000000..9a13f0572 --- /dev/null +++ b/lib/string.h @@ -0,0 +1,18 @@ +#ifndef STRING_WRAPPER_H +#define STRING_WRAPPER_H 1 + +#include_next + +/* Glibc 2.7 has a bug in strtok_r when compiling with optimization that can + * cause segfaults if the delimiters argument is a compile-time constant that + * has exactly 1 character: + * + * http://sources.redhat.com/bugzilla/show_bug.cgi?id=5614 + * + * The bug is only present in the inline version of strtok_r(), so force the + * out-of-line version to be used instead. */ +#if HAVE_STRTOK_R_BUG +#undef strtok_r +#endif + +#endif /* string.h wrapper */