Detect all file overwrites in autoreload_inotify
mv(1) inside the same filesystem was not detected. Supporting this case made it necessary to always watch the directory. Turns out the logic and state keeping between arl_setup() and arl_handle() is easier, when using different watch descriptors for the file and the directory and not using a oneshot descriptor for the file. Requiring an absolute canonical path for arl_setup() simplifies dir and base name splitting. No need for dirname(3) and basename(3) anymore.
This commit is contained in:
		
							
								
								
									
										2
									
								
								main.c
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								main.c
									
									
									
									
									
								
							@@ -723,7 +723,7 @@ void run(void)
 | 
			
		||||
				if (info.fd != -1 && FD_ISSET(info.fd, &fds))
 | 
			
		||||
					read_info();
 | 
			
		||||
				if (arl.fd != -1 && FD_ISSET(arl.fd, &fds)) {
 | 
			
		||||
					if (arl_handle(&arl, files[fileidx].path)) {
 | 
			
		||||
					if (arl_handle(&arl)) {
 | 
			
		||||
						/* when too fast, imlib2 can't load the image */
 | 
			
		||||
						nanosleep(&ten_ms, NULL);
 | 
			
		||||
						load_image(fileidx);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user