From c881fbba94eeb6b814ae1deaca782a78059f49e6 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Tue, 20 Aug 2019 09:25:46 +0200 Subject: [PATCH] mxgrub: Remove redundant exit status checks Callers of the function sys() don't need to check the return value, because sys() doesn't return at all if the external command fails. Remove `and exit 1` after sys(). Closes #52 --- mxgrub/mxgrub | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mxgrub/mxgrub b/mxgrub/mxgrub index 588bfde..18bb491 100755 --- a/mxgrub/mxgrub +++ b/mxgrub/mxgrub @@ -322,18 +322,18 @@ sub cmd_install { update_grub_cfg(); if (has_esp) { - sys 'mount','-L','ESP','/boot/efi' and exit 1; + sys 'mount','-L','ESP','/boot/efi'; if (-d '/boot/efi/EFI/grub/grubx64.efi') { print "GRUB for UEFI is already installed.\n"; } else { - sys 'grub-install','--target=x86_64-efi','--no-nvram',$root_disk and exit 1; + sys 'grub-install','--target=x86_64-efi','--no-nvram',$root_disk; } - sys 'umount','/boot/efi' and exit 1; + sys 'umount','/boot/efi'; } if ($mbr_type ne 'GRUB') { - sys 'grub-install','--target=i386-pc',$root_disk and exit 1; + sys 'grub-install','--target=i386-pc',$root_disk; } else { print "GRUB is already installed in MBR.\n"; }