mirror of
				https://gitea.com/Lydanne/buildx.git
				synced 2025-11-04 18:13:42 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			567 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			567 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// +build !windows
 | 
						|
 | 
						|
package mount
 | 
						|
 | 
						|
import "golang.org/x/sys/unix"
 | 
						|
 | 
						|
func unmountBare(target string, flags int) error {
 | 
						|
	return unix.Unmount(target, flags)
 | 
						|
}
 | 
						|
 | 
						|
func unmount(target string, flags int) error {
 | 
						|
	err := unmountBare(target, flags)
 | 
						|
	if err == nil || err == unix.EINVAL {
 | 
						|
		// Ignore "not mounted" error here. Note the same error
 | 
						|
		// can be returned if flags are invalid, so this code
 | 
						|
		// assumes that the flags value is always correct.
 | 
						|
		return nil
 | 
						|
	}
 | 
						|
 | 
						|
	return &mountError{
 | 
						|
		op:     "umount",
 | 
						|
		target: target,
 | 
						|
		flags:  uintptr(flags),
 | 
						|
		err:    err,
 | 
						|
	}
 | 
						|
}
 |