mirror of
				https://github.com/labwc/labwc.git
				synced 2025-11-03 09:01:51 -05:00 
			
		
		
		
	common/file-helpers.c: share file_exists() to reduce duplication
This commit is contained in:
		
							parent
							
								
									a8951c4b75
								
							
						
					
					
						commit
						a386133068
					
				
					 5 changed files with 26 additions and 17 deletions
				
			
		| 
						 | 
				
			
			@ -8,18 +8,12 @@
 | 
			
		|||
#include <sys/stat.h>
 | 
			
		||||
#include <wlr/util/log.h>
 | 
			
		||||
#include "common/buf.h"
 | 
			
		||||
#include "common/file-helpers.h"
 | 
			
		||||
#include "common/mem.h"
 | 
			
		||||
#include "common/spawn.h"
 | 
			
		||||
#include "common/string-helpers.h"
 | 
			
		||||
#include "config/session.h"
 | 
			
		||||
 | 
			
		||||
static bool
 | 
			
		||||
isfile(const char *path)
 | 
			
		||||
{
 | 
			
		||||
	struct stat st;
 | 
			
		||||
	return (!stat(path, &st));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static bool
 | 
			
		||||
string_empty(const char *s)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -130,7 +124,7 @@ session_autostart_init(const char *dir)
 | 
			
		|||
	if (!autostart) {
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
	if (!isfile(autostart)) {
 | 
			
		||||
	if (!file_exists(autostart)) {
 | 
			
		||||
		wlr_log(WLR_ERROR, "no autostart file");
 | 
			
		||||
		goto out;
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue