From e81378edaeb852c85690a32f5d987c502c88d282 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Mon, 27 Jan 2025 09:32:47 +0100 Subject: [PATCH] clusterd: Remove i686 and amd64 architectures --- clusterd/clusterd | 27 ++++----------------------- 1 file changed, 4 insertions(+), 23 deletions(-) diff --git a/clusterd/clusterd b/clusterd/clusterd index 82f6a66..4723bfd 100755 --- a/clusterd/clusterd +++ b/clusterd/clusterd @@ -981,25 +981,11 @@ sub udp_rx_amdtardata { system '/sbin/make-automaps'; } -our ($machine,$SYS_lchown,$SYS_mknod,$lmtime_sub); +our ($machine,$SYS_lchown,$SYS_mknod); our ($SYS_utimensat,$AT_FDCWD,$UTIME_OMIT,$AT_SYMLINK_NOFOLLOW); -sub lmtime_unsupported { - my ($path,$mtime)=@_; - warn "$path: don't known how to change symlink mtime on target architecture\n"; -} -sub lmtime_utimensat { - my ($path,$mtime)=@_; - my $tsa=pack 'qqqq',0,$UTIME_OMIT,$mtime,0; - syscall($SYS_utimensat,$AT_FDCWD,$path,$tsa,$AT_SYMLINK_NOFOLLOW)==0 or return warn "$path: failed to lmtime: $!\n"; -} -$lmtime_sub=\&lmtime_unsupported; - chomp($machine=`uname -m`); -if ($machine eq 'i686') { - $SYS_lchown=198; # __NR_lchown32 in /usr/include/asm/unistd.h - $SYS_mknod=14; # __NR_mknod -} elsif ($machine eq 'x86_64') { +if ($machine eq 'x86_64') { $SYS_lchown=94; # __NR_lchown in /usr/include/asm-x86_64/unistd.h $SYS_mknod=133; # __NR_mknod @@ -1007,10 +993,6 @@ if ($machine eq 'i686') { $AT_FDCWD=-100; # /usr/include/fcntl.h $UTIME_OMIT=(1<<30)-2; # /usr/include/bits/stat.h $AT_SYMLINK_NOFOLLOW=0x100; # /usr/include/fcntl.h - $lmtime_sub=\&lmtime_utimensat; -} elsif ($machine eq 'amd64') { - $SYS_lchown=254; # SYS_lchown in /usr/include/syscall.h - $SYS_mknod=14; # SYS_mknod } elsif ($machine eq 'ppc64le') { $SYS_lchown=16; # __NR_lchown in /usr/include/powerpc64le-linux-gnu/asm/unistd.h $SYS_mknod=14; # __NR_mknod @@ -1019,7 +1001,6 @@ if ($machine eq 'i686') { $AT_FDCWD=-100; # /usr/include/linux/fcntl.h $UTIME_OMIT=(1<<30)-2; # /usr/include/powerpc64le-linux-gnu/bits/stat.h $AT_SYMLINK_NOFOLLOW=0x100; # /usr/include/linux/fcntl.h - $lmtime_sub=\&lmtime_utimensat; } else { warn "unknown machine type $machine: symlink ownership can't be set.\n"; warn "unknown machine type $machine: named pipes,character and block devices can't be created\n"; @@ -1033,8 +1014,8 @@ sub lchown { sub lmtime { my ($mtime,$path)=@_; - $lmtime_sub or return; - $lmtime_sub->($path,$mtime); + my $tsa=pack 'qqqq',0,$UTIME_OMIT,$mtime,0; + syscall($SYS_utimensat,$AT_FDCWD,$path,$tsa,$AT_SYMLINK_NOFOLLOW)==0 or return warn "$path: failed to lmtime: $!\n"; } sub udp_rx_filedata {