aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-01-06 12:54:46 +0100
committerMax Kellermann <max@duempel.org>2015-01-06 12:54:46 +0100
commit674d14879ff638e9ed34ef7d8557f2aa33b5e204 (patch)
tree31c2fa65808b08d14021b265ab9ce9b4bcd4e2f1 /src
parent81df45a893e8ac459ce10f0514058003027c0830 (diff)
parent37e9010887783c307355f3144786ed72e8a973b0 (diff)
downloadmpd-674d14879ff638e9ed34ef7d8557f2aa33b5e204.tar.gz
mpd-674d14879ff638e9ed34ef7d8557f2aa33b5e204.tar.xz
mpd-674d14879ff638e9ed34ef7d8557f2aa33b5e204.zip
Merge branch 'v0.19.x'
Diffstat (limited to 'src')
-rw-r--r--src/input/AsyncInputStream.cxx5
-rw-r--r--src/thread/Name.hxx20
2 files changed, 19 insertions, 6 deletions
diff --git a/src/input/AsyncInputStream.cxx b/src/input/AsyncInputStream.cxx
index 3bc281c43..68cb8ff68 100644
--- a/src/input/AsyncInputStream.cxx
+++ b/src/input/AsyncInputStream.cxx
@@ -160,6 +160,11 @@ AsyncInputStream::SeekDone()
assert(io_thread_inside());
assert(IsSeekPending());
+ /* we may have reached end-of-file previously, and the
+ connection may have been closed already; however after
+ seeking successfully, the connection must be alive again */
+ open = true;
+
seek_state = SeekState::NONE;
cond.broadcast();
}
diff --git a/src/thread/Name.hxx b/src/thread/Name.hxx
index 0d70de139..1576b3fde 100644
--- a/src/thread/Name.hxx
+++ b/src/thread/Name.hxx
@@ -20,17 +20,25 @@
#ifndef MPD_THREAD_NAME_HXX
#define MPD_THREAD_NAME_HXX
-#ifdef HAVE_PTHREAD_SETNAME_NP
-#include <pthread.h>
-#include <stdio.h>
+#if defined(HAVE_PTHREAD_SETNAME_NP) && !defined(__NetBSD__)
+# define HAVE_THREAD_NAME
+# include <pthread.h>
+# include <stdio.h>
#elif defined(HAVE_PRCTL)
-#include <sys/prctl.h>
+# include <sys/prctl.h>
+# ifdef PR_SET_NAME
+# define HAVE_THREAD_NAME
+# endif
#endif
static inline void
SetThreadName(const char *name)
{
-#ifdef HAVE_PTHREAD_SETNAME_NP
+#if defined(HAVE_PTHREAD_SETNAME_NP) && !defined(__NetBSD__)
+ /* not using pthread_setname_np() on NetBSD because it
+ requires a non-const pointer argument, which we don't have
+ here */
+
#ifdef __APPLE__
pthread_setname_np(name);
#else
@@ -47,7 +55,7 @@ template<typename... Args>
static inline void
FormatThreadName(const char *fmt, gcc_unused Args&&... args)
{
-#ifdef HAVE_PTHREAD_SETNAME_NP
+#ifdef HAVE_THREAD_NAME
char buffer[16];
snprintf(buffer, sizeof(buffer), fmt, args...);
SetThreadName(buffer);