]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/bsys.c
Fix header file includes.
[bacula/bacula] / bacula / src / lib / bsys.c
index 5f4775fddbfe49ef3d045018a8e516a2d0a1d4d2..26a9b72cae212edfec376179203d659d79ff9db9 100644 (file)
@@ -367,7 +367,8 @@ void _v(char *file, int line, pthread_mutex_t *m)
 {
    int errstat;
 
-   if ((errstat=pthread_mutex_tryunlock(m)) == 0) {
+   /* Note, this trylock *should* fail if the mutex is locked */
+   if ((errstat=pthread_mutex_trylock(m)) == 0) {
       berrno be;
       e_msg(file, line, M_ERROR, 0, _("Mutex unlock not locked. ERR=%s\n"),
            be.strerror(errstat));
@@ -416,7 +417,7 @@ void b_memset(const char *file, int line, void *mem, int val, size_t num)
 }
 #endif
 
-#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
+#if !defined(HAVE_WIN32)
 static int del_pid_file_ok = FALSE;
 #endif
 
@@ -425,7 +426,7 @@ static int del_pid_file_ok = FALSE;
  */
 void create_pid_file(char *dir, const char *progname, int port)
 {
-#if !defined(HAVE_CYGWIN) && !defined(HAVE_WIN32)
+#if !defined(HAVE_WIN32)
    int pidfd, len;
    int oldpid;
    char  pidbuf[20];
@@ -468,7 +469,7 @@ void create_pid_file(char *dir, const char *progname, int port)
  */
 int delete_pid_file(char *dir, const char *progname, int port)
 {
-#if !defined(HAVE_CYGWIN)  && !defined(HAVE_WIN32)
+#if !defined(HAVE_WIN32)
    POOLMEM *fname = get_pool_memory(PM_FNAME);
 
    if (!del_pid_file_ok) {