Zorro Lang <zlang@xxxxxxxxxx> writes: > On Fri, Apr 04, 2025 at 10:34:47AM +0530, Ritesh Harjani wrote: >> "Nirjhar Roy (IBM)" <nirjhar.roy.lists@xxxxxxxxx> writes: >> >> > Replace exit <return-val> with _exit <return-val> which >> > is introduced in the previous patch. >> > >> > Signed-off-by: Nirjhar Roy (IBM) <nirjhar.roy.lists@xxxxxxxxx> <...> >> > --- >> > @@ -225,7 +225,7 @@ _filter_bmap() >> > die_now() >> > { >> > status=1 >> > - exit >> > + _exit >> >> Why not remove status=1 too and just do _exit 1 here too? >> Like how we have done at other places? > > Yeah, nice catch! As the defination of _exit: > > _exit() > { > status="$1" > exit "$status" > } > > The > " > status=1 > exit > " > should be equal to: > " > _exit 1 > " > > And "_exit" looks not make sense, due to it gives null to status. > > Same problem likes below: > > > @@ -3776,7 +3773,7 @@ _get_os_name() > echo 'linux' > else > echo Unknown operating system: `uname` > - exit > + _exit > > > The "_exit" without argument looks not make sense. > That's right. _exit called with no argument could make status as null. To prevent such misuse in future, should we add a warning/echo message if the no. of arguments passed to _exit() is not 1? -ritesh