mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	creds: Unbreak build without HAVE_CREDS
A recent patch broke the build on FreeBSD, which does not have HAVE_CREDS defined. Also, make sure any attempts to enable the srbchannel on such architectures fail. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=80642 Reported-by: Ryan Lortie Signed-off-by: David Henningsson <david.henningsson@canonical.com>
This commit is contained in:
		
							parent
							
								
									3be8382fcd
								
							
						
					
					
						commit
						2bfedb9f73
					
				
					 3 changed files with 21 additions and 0 deletions
				
			
		| 
						 | 
					@ -1411,6 +1411,8 @@ finish:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void pa_command_enable_srbchannel(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
 | 
					static void pa_command_enable_srbchannel(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
 | 
				
			||||||
    pa_context *c = userdata;
 | 
					    pa_context *c = userdata;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAVE_CREDS
 | 
				
			||||||
    const int *fds;
 | 
					    const int *fds;
 | 
				
			||||||
    int nfd;
 | 
					    int nfd;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1439,6 +1441,11 @@ static void pa_command_enable_srbchannel(pa_pdispatch *pd, uint32_t command, uin
 | 
				
			||||||
    c->srb_setup_tag = tag;
 | 
					    c->srb_setup_tag = tag;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    pa_context_unref(c);
 | 
					    pa_context_unref(c);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					    pa_assert(c);
 | 
				
			||||||
 | 
					    pa_context_fail(c, PA_ERR_PROTOCOL);
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void pa_command_disable_srbchannel(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
 | 
					static void pa_command_disable_srbchannel(pa_pdispatch *pd, uint32_t command, uint32_t tag, pa_tagstruct *t, void *userdata) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -438,6 +438,8 @@ pa_pdispatch* pa_pdispatch_ref(pa_pdispatch *pd) {
 | 
				
			||||||
    return pd;
 | 
					    return pd;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAVE_CREDS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const pa_creds * pa_pdispatch_creds(pa_pdispatch *pd) {
 | 
					const pa_creds * pa_pdispatch_creds(pa_pdispatch *pd) {
 | 
				
			||||||
    pa_assert(pd);
 | 
					    pa_assert(pd);
 | 
				
			||||||
    pa_assert(PA_REFCNT_VALUE(pd) >= 1);
 | 
					    pa_assert(PA_REFCNT_VALUE(pd) >= 1);
 | 
				
			||||||
| 
						 | 
					@ -460,3 +462,5 @@ const int * pa_pdispatch_fds(pa_pdispatch *pd, int *nfd) {
 | 
				
			||||||
    *nfd = 0;
 | 
					    *nfd = 0;
 | 
				
			||||||
    return NULL;
 | 
					    return NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -42,6 +42,8 @@ static void pa_pstream_send_tagstruct_with_ancil(pa_pstream *p, pa_tagstruct *t,
 | 
				
			||||||
    pa_packet_unref(packet);
 | 
					    pa_packet_unref(packet);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#ifdef HAVE_CREDS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pa_pstream_send_tagstruct_with_creds(pa_pstream *p, pa_tagstruct *t, const pa_creds *creds) {
 | 
					void pa_pstream_send_tagstruct_with_creds(pa_pstream *p, pa_tagstruct *t, const pa_creds *creds) {
 | 
				
			||||||
    if (creds) {
 | 
					    if (creds) {
 | 
				
			||||||
        pa_ancil a;
 | 
					        pa_ancil a;
 | 
				
			||||||
| 
						 | 
					@ -69,6 +71,14 @@ void pa_pstream_send_tagstruct_with_fds(pa_pstream *p, pa_tagstruct *t, int nfd,
 | 
				
			||||||
        pa_pstream_send_tagstruct_with_ancil(p, t, NULL);
 | 
					        pa_pstream_send_tagstruct_with_ancil(p, t, NULL);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void pa_pstream_send_tagstruct_with_creds(pa_pstream *p, pa_tagstruct *t, const pa_creds *creds) {
 | 
				
			||||||
 | 
					    pa_pstream_send_tagstruct_with_ancil(p, t, NULL);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void pa_pstream_send_error(pa_pstream *p, uint32_t tag, uint32_t error) {
 | 
					void pa_pstream_send_error(pa_pstream *p, uint32_t tag, uint32_t error) {
 | 
				
			||||||
    pa_tagstruct *t;
 | 
					    pa_tagstruct *t;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue