mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-31 16:12:24 -05:00 
			
		
		
		
	update ncruces/go-sqlite3 to v0.21.2 (#3626)
This commit is contained in:
		
					parent
					
						
							
								9697df0955
							
						
					
				
			
			
				commit
				
					
						c953f57e55
					
				
			
		
					 14 changed files with 203 additions and 46 deletions
				
			
		
							
								
								
									
										29
									
								
								vendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								vendor/github.com/ncruces/go-sqlite3/internal/dotlk/dotlk.go
									
										
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,29 @@ | |||
| package dotlk | ||||
| 
 | ||||
| import ( | ||||
| 	"errors" | ||||
| 	"io/fs" | ||||
| 	"os" | ||||
| ) | ||||
| 
 | ||||
| // LockShm creates a directory on disk to prevent SQLite | ||||
| // from using this path for a shared memory file. | ||||
| func LockShm(name string) error { | ||||
| 	err := os.Mkdir(name, 0777) | ||||
| 	if errors.Is(err, fs.ErrExist) { | ||||
| 		s, err := os.Lstat(name) | ||||
| 		if err == nil && s.IsDir() { | ||||
| 			return nil | ||||
| 		} | ||||
| 	} | ||||
| 	return err | ||||
| } | ||||
| 
 | ||||
| // Unlock removes the lock or shared memory file. | ||||
| func Unlock(name string) error { | ||||
| 	err := os.Remove(name) | ||||
| 	if errors.Is(err, fs.ErrNotExist) { | ||||
| 		return nil | ||||
| 	} | ||||
| 	return err | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue