mirror of
https://git.proxmox.com/git/pve-common
synced 2025-07-25 12:49:36 +00:00
tools: sync_mountpoint: throw actual error is syncfs fails
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
b260d4e320
commit
09d47f9d47
@ -1434,9 +1434,12 @@ sub fsync($) {
|
||||
sub sync_mountpoint {
|
||||
my ($path) = @_;
|
||||
sysopen my $fd, $path, O_RDONLY|O_CLOEXEC or die "failed to open $path: $!\n";
|
||||
my $result = syncfs(fileno($fd));
|
||||
my $syncfs_err;
|
||||
if (!syncfs(fileno($fd))) {
|
||||
$syncfs_err = "$!";
|
||||
}
|
||||
close($fd);
|
||||
return $result;
|
||||
die "syncfs '$path' failed - $syncfs_err\n" if defined $syncfs_err;
|
||||
}
|
||||
|
||||
# support sending multi-part mail messages with a text and or a HTML part
|
||||
|
Loading…
Reference in New Issue
Block a user