~mirabilos/dietlibc/MAIN

« back to all changes in this revision

Viewing changes to libpthread/pthread_sys_logging.c

  • Committer: leitner
  • Date: 2020-04-01 16:22:54 UTC
  • Revision ID: leitner-20200401162254-4w05ek0971asiotq
  add support for gcc 10's __attribute__((access(...)))
  remove some compiler warnings

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
static pthread_mutex_t mutex_syslog=PTHREAD_MUTEX_INITIALIZER;
10
10
 
11
11
void closelog(void) {
12
 
  pthread_cleanup_push((void(*)(void*))pthread_mutex_unlock,&mutex_syslog);
 
12
  pthread_cleanup_push((void*)pthread_mutex_unlock,&mutex_syslog);
13
13
  pthread_mutex_lock(&mutex_syslog);
14
14
  __libc_closelog();
15
15
  pthread_cleanup_pop(1);
16
16
}
17
17
 
18
18
void openlog(const char*ident,int option,int facility) {
19
 
  pthread_cleanup_push((void(*)(void*))pthread_mutex_unlock,&mutex_syslog);
 
19
  pthread_cleanup_push((void*)pthread_mutex_unlock,&mutex_syslog);
20
20
  pthread_mutex_lock(&mutex_syslog);
21
21
  __libc_openlog(ident, option, facility);
22
22
  pthread_cleanup_pop(1);
23
23
}
24
24
 
25
25
void vsyslog(int priority,const char*format,va_list arg_ptr) {
26
 
  pthread_cleanup_push((void(*)(void*))pthread_mutex_unlock,&mutex_syslog);
 
26
  pthread_cleanup_push((void*)pthread_mutex_unlock,&mutex_syslog);
27
27
  pthread_mutex_lock(&mutex_syslog);
28
28
  __libc_vsyslog(priority, format, arg_ptr);
29
29
  pthread_cleanup_pop(1);