From 6a5f3c599c556ac87d1316aad6a6df806af8c9a5 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Sun, 20 Dec 2020 11:58:53 +0100 Subject: [PATCH] pthread_mutexattr_setrobust.3: ffix Signed-off-by: Michael Kerrisk --- man3/pthread_mutexattr_setrobust.3 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/man3/pthread_mutexattr_setrobust.3 b/man3/pthread_mutexattr_setrobust.3 index abd762687..50d115614 100644 --- a/man3/pthread_mutexattr_setrobust.3 +++ b/man3/pthread_mutexattr_setrobust.3 @@ -202,10 +202,10 @@ The following shell session shows what we see when running this program: $ \fB./a.out\fP [original owner] Setting lock... [original owner] Locked. Now exiting without unlocking. -[main thread] Attempting to lock the robust mutex. -[main thread] pthread_mutex_lock() returned EOWNERDEAD -[main thread] Now make the mutex consistent -[main thread] Mutex is now consistent; unlocking +[main] Attempting to lock the robust mutex. +[main] pthread_mutex_lock() returned EOWNERDEAD +[main] Now make the mutex consistent +[main] Mutex is now consistent; unlocking .EE .in .SS Program source @@ -217,7 +217,7 @@ $ \fB./a.out\fP #include #define handle_error_en(en, msg) \e - do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) + do { errno = en; perror(msg); exit(EXIT_FAILURE); } while (0) static pthread_mutex_t mtx; @@ -250,25 +250,25 @@ main(int argc, char *argv[]) /* "original_owner_thread" should have exited by now */ - printf("[main thread] Attempting to lock the robust mutex.\en"); + printf("[main] Attempting to lock the robust mutex.\en"); s = pthread_mutex_lock(&mtx); if (s == EOWNERDEAD) { - printf("[main thread] pthread_mutex_lock() returned EOWNERDEAD\en"); - printf("[main thread] Now make the mutex consistent\en"); + printf("[main] pthread_mutex_lock() returned EOWNERDEAD\en"); + printf("[main] Now make the mutex consistent\en"); s = pthread_mutex_consistent(&mtx); if (s != 0) handle_error_en(s, "pthread_mutex_consistent"); - printf("[main thread] Mutex is now consistent; unlocking\en"); + printf("[main] Mutex is now consistent; unlocking\en"); s = pthread_mutex_unlock(&mtx); if (s != 0) handle_error_en(s, "pthread_mutex_unlock"); exit(EXIT_SUCCESS); } else if (s == 0) { - printf("[main thread] pthread_mutex_lock() unexpectedly succeeded\en"); + printf("[main] pthread_mutex_lock() unexpectedly succeeded\en"); exit(EXIT_FAILURE); } else { - printf("[main thread] pthread_mutex_lock() unexpectedly failed\en"); + printf("[main] pthread_mutex_lock() unexpectedly failed\en"); handle_error_en(s, "pthread_mutex_lock"); } }