mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	conf: try to load state from where we saved it
When XDG_STATE_HOME is unset, we save in $HOME/.local/state/pipewire, so try to first load the state file from there as well before we try to fall back to the old XDG_CONFIG_HOME location.
This commit is contained in:
		
							parent
							
								
									55c264d2a5
								
							
						
					
					
						commit
						7fda66142b
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -187,6 +187,13 @@ static int get_state_path(char *path, size_t size, const char *prefix, const cha
 | 
			
		|||
			dir = result ? result->pw_dir : NULL;
 | 
			
		||||
	}
 | 
			
		||||
	if (dir != NULL) {
 | 
			
		||||
		const char *paths[] = { dir, ".local", "state", "pipewire", prefix, name, NULL };
 | 
			
		||||
		if (make_path(path, size, paths) == 0 &&
 | 
			
		||||
		    access(path, R_OK) == 0)
 | 
			
		||||
			return 1;
 | 
			
		||||
	}
 | 
			
		||||
	if (dir != NULL) {
 | 
			
		||||
		/* fallback for old XDG_CONFIG_HOME */
 | 
			
		||||
		const char *paths[] = { dir, ".config", "pipewire", prefix, name, NULL };
 | 
			
		||||
		if (make_path(path, size, paths) == 0 &&
 | 
			
		||||
		    access(path, R_OK) == 0)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue