summaryrefslogtreecommitdiffstats
path: root/common.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:43:33 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:43:33 +0000
commit18525b97f1a4b60884962d8fb326e8e85d837686 (patch)
tree99125a3d130d197d38d03df460e7ec1634784b8f /common.cc
parentReleasing debian version 0.19-2. (diff)
downloadtarlz-18525b97f1a4b60884962d8fb326e8e85d837686.tar.xz
tarlz-18525b97f1a4b60884962d8fb326e8e85d837686.zip
Merging upstream version 0.21.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'common.cc')
-rw-r--r--common.cc25
1 files changed, 10 insertions, 15 deletions
diff --git a/common.cc b/common.cc
index 22958ec..a493e11 100644
--- a/common.cc
+++ b/common.cc
@@ -19,31 +19,26 @@
#include <cctype>
#include <cerrno>
-#include <climits>
#include <cstdlib>
-#include <cstring>
-#include <string>
-#include <vector>
#include <pthread.h>
-#include <stdint.h>
#include <unistd.h>
-#include "arg_parser.h"
#include "tarlz.h"
+#include "arg_parser.h"
void xinit_mutex( pthread_mutex_t * const mutex )
{
const int errcode = pthread_mutex_init( mutex, 0 );
if( errcode )
- { show_error( "pthread_mutex_init", errcode ); cleanup_and_fail(); }
+ { show_error( "pthread_mutex_init", errcode ); exit_fail_mt(); }
}
void xinit_cond( pthread_cond_t * const cond )
{
const int errcode = pthread_cond_init( cond, 0 );
if( errcode )
- { show_error( "pthread_cond_init", errcode ); cleanup_and_fail(); }
+ { show_error( "pthread_cond_init", errcode ); exit_fail_mt(); }
}
@@ -51,14 +46,14 @@ void xdestroy_mutex( pthread_mutex_t * const mutex )
{
const int errcode = pthread_mutex_destroy( mutex );
if( errcode )
- { show_error( "pthread_mutex_destroy", errcode ); cleanup_and_fail(); }
+ { show_error( "pthread_mutex_destroy", errcode ); exit_fail_mt(); }
}
void xdestroy_cond( pthread_cond_t * const cond )
{
const int errcode = pthread_cond_destroy( cond );
if( errcode )
- { show_error( "pthread_cond_destroy", errcode ); cleanup_and_fail(); }
+ { show_error( "pthread_cond_destroy", errcode ); exit_fail_mt(); }
}
@@ -66,7 +61,7 @@ void xlock( pthread_mutex_t * const mutex )
{
const int errcode = pthread_mutex_lock( mutex );
if( errcode )
- { show_error( "pthread_mutex_lock", errcode ); cleanup_and_fail(); }
+ { show_error( "pthread_mutex_lock", errcode ); exit_fail_mt(); }
}
@@ -74,7 +69,7 @@ void xunlock( pthread_mutex_t * const mutex )
{
const int errcode = pthread_mutex_unlock( mutex );
if( errcode )
- { show_error( "pthread_mutex_unlock", errcode ); cleanup_and_fail(); }
+ { show_error( "pthread_mutex_unlock", errcode ); exit_fail_mt(); }
}
@@ -82,7 +77,7 @@ void xwait( pthread_cond_t * const cond, pthread_mutex_t * const mutex )
{
const int errcode = pthread_cond_wait( cond, mutex );
if( errcode )
- { show_error( "pthread_cond_wait", errcode ); cleanup_and_fail(); }
+ { show_error( "pthread_cond_wait", errcode ); exit_fail_mt(); }
}
@@ -90,7 +85,7 @@ void xsignal( pthread_cond_t * const cond )
{
const int errcode = pthread_cond_signal( cond );
if( errcode )
- { show_error( "pthread_cond_signal", errcode ); cleanup_and_fail(); }
+ { show_error( "pthread_cond_signal", errcode ); exit_fail_mt(); }
}
@@ -98,7 +93,7 @@ void xbroadcast( pthread_cond_t * const cond )
{
const int errcode = pthread_cond_broadcast( cond );
if( errcode )
- { show_error( "pthread_cond_broadcast", errcode ); cleanup_and_fail(); }
+ { show_error( "pthread_cond_broadcast", errcode ); exit_fail_mt(); }
}