aboutsummaryrefslogtreecommitdiff
path: root/dlfcn
diff options
context:
space:
mode:
Diffstat (limited to 'dlfcn')
-rw-r--r--dlfcn/bug-atexit3-lib.cc12
1 files changed, 10 insertions, 2 deletions
diff --git a/dlfcn/bug-atexit3-lib.cc b/dlfcn/bug-atexit3-lib.cc
index 3d01ea8..aba7720 100644
--- a/dlfcn/bug-atexit3-lib.cc
+++ b/dlfcn/bug-atexit3-lib.cc
@@ -1,14 +1,22 @@
#include <unistd.h>
+#include <string.h>
+
+static void
+write_message (const char *message)
+{
+ ssize_t unused __attribute__ ((unused));
+ unused = write (STDOUT_FILENO, message, strlen (message));
+}
struct statclass
{
statclass()
{
- write (1, "statclass\n", 10);
+ write_message ("statclass\n");
}
~statclass()
{
- write (1, "~statclass\n", 11);
+ write_message ("~statclass\n");
}
};