Skip to content

Commit 21f532d

Browse files
committed
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 <[email protected]>
1 parent 03bfcd8 commit 21f532d

5 files changed

Lines changed: 5 additions & 6 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package sys
17+
package mount
1818

1919
import (
2020
"runtime"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package sys
17+
package mount
1818

1919
import (
2020
"io/ioutil"
@@ -32,7 +32,7 @@ import (
3232
type fMountatCaseFunc func(t *testing.T, root string)
3333

3434
func TestFMountat(t *testing.T) {
35-
if !runningPrivileged() {
35+
if unix.Geteuid() != 0 {
3636
t.Skip("Needs to be run as root")
3737
return
3838
}

mount/mount_linux.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import (
2424
"strings"
2525
"time"
2626

27-
"github.com/containerd/containerd/sys"
2827
"github.com/pkg/errors"
2928
"golang.org/x/sys/unix"
3029
)
@@ -378,7 +377,7 @@ func mountAt(chdir string, source, target, fstype string, flags uintptr, data st
378377
if !fs.IsDir() {
379378
return errors.Wrap(errors.Errorf("%s is not dir", chdir), "failed to mountat")
380379
}
381-
return errors.Wrap(sys.FMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat")
380+
return errors.Wrap(FMountat(f.Fd(), source, target, fstype, flags, data), "failed to mountat")
382381
}
383382

384383
func (m *Mount) mountWithHelper(helperBinary, typePrefix, target string) error {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
limitations under the License.
1515
*/
1616

17-
package sys
17+
package mount
1818

1919
import (
2020
_ "unsafe" // required for go:linkname.

0 commit comments

Comments
 (0)