"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "archive/tar_mostunix.go" between
containerd-1.5.3.tar.gz and containerd-1.5.4.tar.gz

About: containerd is a container runtime with an emphasis on simplicity, robustness and portability.

tar_mostunix.go  (containerd-1.5.3):tar_mostunix.go  (containerd-1.5.4)
skipping to change at line 21 skipping to change at line 21
Unless required by applicable law or agreed to in writing, software Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS, distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/ */
package archive package archive
import "golang.org/x/sys/unix" import (
"os"
"golang.org/x/sys/unix"
)
// mknod wraps Unix.Mknod and casts dev to int // mknod wraps Unix.Mknod and casts dev to int
func mknod(path string, mode uint32, dev uint64) error { func mknod(path string, mode uint32, dev uint64) error {
return unix.Mknod(path, mode, int(dev)) return unix.Mknod(path, mode, int(dev))
} }
// lsetxattrCreate wraps unix.Lsetxattr, passes the unix.XATTR_CREATE flag on // lsetxattrCreate wraps unix.Lsetxattr, passes the unix.XATTR_CREATE flag on
// supported operating systems,and ignores appropriate errors // supported operating systems,and ignores appropriate errors
func lsetxattrCreate(link string, attr string, data []byte) error { func lsetxattrCreate(link string, attr string, data []byte) error {
err := unix.Lsetxattr(link, attr, data, unix.XATTR_CREATE) err := unix.Lsetxattr(link, attr, data, unix.XATTR_CREATE)
if err == unix.ENOTSUP || err == unix.ENODATA || err == unix.EEXIST { if err == unix.ENOTSUP || err == unix.ENODATA || err == unix.EEXIST {
return nil return nil
} }
return err return err
} }
// lchmod checks for symlink and changes the mode if not a symlink
func lchmod(path string, mode os.FileMode) error {
fi, err := os.Lstat(path)
if err != nil {
return err
}
if fi.Mode()&os.ModeSymlink == 0 {
if err := os.Chmod(path, mode); err != nil {
return err
}
}
return nil
}
 End of changes. 2 change blocks. 
1 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)