|  | @@ -45,7 +45,7 @@
 | 
											
												
													
														|  |  #endif
 |  |  #endif
 | 
											
												
													
														|  |  #else
 |  |  #else
 | 
											
												
													
														|  |  #if defined(__GNUC__) && !defined(_GNU_SOURCE)
 |  |  #if defined(__GNUC__) && !defined(_GNU_SOURCE)
 | 
											
												
													
														|  | -#define _GNU_SOURCE /* for setgroups() */
 |  | 
 | 
											
												
													
														|  | 
 |  | +#define _GNU_SOURCE /* for setgroups(), pthread_setname_np() */
 | 
											
												
													
														|  |  #endif
 |  |  #endif
 | 
											
												
													
														|  |  #if defined(__linux__) && !defined(_XOPEN_SOURCE)
 |  |  #if defined(__linux__) && !defined(_XOPEN_SOURCE)
 | 
											
												
													
														|  |  #define _XOPEN_SOURCE 600 /* For flockfile() on Linux */
 |  |  #define _XOPEN_SOURCE 600 /* For flockfile() on Linux */
 | 
											
										
											
												
													
														|  | @@ -2941,7 +2941,7 @@ mg_set_thread_name(const char *name)
 | 
											
												
													
														|  |  #elif defined(__MINGW32__)
 |  |  #elif defined(__MINGW32__)
 | 
											
												
													
														|  |  /* No option known to set thread name for MinGW */
 |  |  /* No option known to set thread name for MinGW */
 | 
											
												
													
														|  |  #endif
 |  |  #endif
 | 
											
												
													
														|  | -#elif defined(__GLIBC__)                                                       \
 |  | 
 | 
											
												
													
														|  | 
 |  | +#elif defined(_GNU_SOURCE) && defined(__GLIBC__)                                                       \
 | 
											
												
													
														|  |      && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12)))
 |  |      && ((__GLIBC__ > 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12)))
 | 
											
												
													
														|  |  	/* pthread_setname_np first appeared in glibc in version 2.12*/
 |  |  	/* pthread_setname_np first appeared in glibc in version 2.12*/
 | 
											
												
													
														|  |  	(void)pthread_setname_np(pthread_self(), threadName);
 |  |  	(void)pthread_setname_np(pthread_self(), threadName);
 |