mirror of
				https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
				synced 2025-11-03 09:01:50 -05:00 
			
		
		
		
	core-util: set_scheduler: check for RLIMIT_RTTIME
set_scheduler() assumes that if sys/resource.h was found then we will find RLIMIT_RTTIME there, but this is a non-POSIX extension on Linux. Change the check to ensure that RLIMIT_RTTIME is actually defined. Linux indeed defines this as a macro, and POSIX specifies that the other RLIMIT_ constants must be macros, so having this as an #ifdef seems correct.
This commit is contained in:
		
							parent
							
								
									1588212d5a
								
							
						
					
					
						commit
						6f954c7674
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -707,7 +707,7 @@ static int set_scheduler(int rtprio) {
 | 
				
			||||||
#ifdef HAVE_DBUS
 | 
					#ifdef HAVE_DBUS
 | 
				
			||||||
    int r;
 | 
					    int r;
 | 
				
			||||||
    long long rttime;
 | 
					    long long rttime;
 | 
				
			||||||
#ifdef HAVE_SYS_RESOURCE_H
 | 
					#ifdef RLIMIT_RTTIME
 | 
				
			||||||
    struct rlimit rl;
 | 
					    struct rlimit rl;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    DBusError error;
 | 
					    DBusError error;
 | 
				
			||||||
| 
						 | 
					@ -749,7 +749,7 @@ static int set_scheduler(int rtprio) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    rttime = rtkit_get_rttime_usec_max(bus);
 | 
					    rttime = rtkit_get_rttime_usec_max(bus);
 | 
				
			||||||
    if (rttime >= 0) {
 | 
					    if (rttime >= 0) {
 | 
				
			||||||
#ifdef HAVE_SYS_RESOURCE_H
 | 
					#ifdef RLIMIT_RTTIME
 | 
				
			||||||
        r = getrlimit(RLIMIT_RTTIME, &rl);
 | 
					        r = getrlimit(RLIMIT_RTTIME, &rl);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (r >= 0 && (long long) rl.rlim_max > rttime) {
 | 
					        if (r >= 0 && (long long) rl.rlim_max > rttime) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue