move sys.FMountat() into mount package
It's the only location this is used, so might as well move it into that package. I could not find external users of this utility, so not adding an alias / deprecation. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
		| @@ -14,7 +14,7 @@ | ||||
|    limitations under the License. | ||||
| */ | ||||
| 
 | ||||
| package sys | ||||
| package mount | ||||
| 
 | ||||
| import ( | ||||
| 	"runtime" | ||||
| @@ -14,7 +14,7 @@ | ||||
|    limitations under the License. | ||||
| */ | ||||
| 
 | ||||
| package sys | ||||
| package mount | ||||
| 
 | ||||
| import ( | ||||
| 	"io/ioutil" | ||||
| @@ -32,7 +32,7 @@ import ( | ||||
| type fMountatCaseFunc func(t *testing.T, root string) | ||||
| 
 | ||||
| func TestFMountat(t *testing.T) { | ||||
| 	if !runningPrivileged() { | ||||
| 	if unix.Geteuid() != 0 { | ||||
| 		t.Skip("Needs to be run as root") | ||||
| 		return | ||||
| 	} | ||||
| @@ -24,7 +24,6 @@ import ( | ||||
| 	"strings" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/containerd/containerd/sys" | ||||
| 	"github.com/pkg/errors" | ||||
| 	"golang.org/x/sys/unix" | ||||
| ) | ||||
| @@ -378,7 +377,7 @@ func mountAt(chdir string, source, target, fstype string, flags uintptr, data st | ||||
| 	if !fs.IsDir() { | ||||
| 		return errors.Wrap(errors.Errorf("%s is not dir", chdir), "failed to mountat") | ||||
| 	} | ||||
| 	return errors.Wrap(sys.FMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat") | ||||
| 	return errors.Wrap(FMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat") | ||||
| } | ||||
|  | ||||
| func (m *Mount) mountWithHelper(helperBinary, typePrefix, target string) error { | ||||
|   | ||||
| @@ -14,7 +14,7 @@ | ||||
|    limitations under the License. | ||||
| */ | ||||
| 
 | ||||
| package sys | ||||
| package mount | ||||
| 
 | ||||
| import ( | ||||
| 	_ "unsafe" // required for go:linkname. | ||||
		Reference in New Issue
	
	Block a user
	 Sebastiaan van Stijn
					Sebastiaan van Stijn