svn commit: r355318 - head/sbin/newfs_msdos

Conrad Meyer cem at freebsd.org
Tue Dec 3 22:02:49 UTC 2019


Hi Xin Li,

Is there a reason to prefer exit() over returning from main?  I have
not surveyed the source tree, but I suspect most programs in base exit
by returning from main rather than explicit exit(3).

Thanks,
Conrad

On Mon, Dec 2, 2019 at 11:03 PM Xin LI <delphij at freebsd.org> wrote:
>
> Author: delphij
> Date: Tue Dec  3 07:03:25 2019
> New Revision: 355318
> URL: https://svnweb.freebsd.org/changeset/base/355318
>
> Log:
>   Explicitly exit() instead of return in main().
>
>   MFC after:    2 weeks
>
> Modified:
>   head/sbin/newfs_msdos/newfs_msdos.c
>
> Modified: head/sbin/newfs_msdos/newfs_msdos.c
> ==============================================================================
> --- head/sbin/newfs_msdos/newfs_msdos.c Tue Dec  3 07:01:28 2019        (r355317)
> +++ head/sbin/newfs_msdos/newfs_msdos.c Tue Dec  3 07:03:25 2019        (r355318)
> @@ -189,7 +189,7 @@ main(int argc, char *argv[])
>             err(1, NULL);
>      }
>      dtype = *argv;
> -    return !!mkfs_msdos(fname, dtype, &o);
> +    exit(!!mkfs_msdos(fname, dtype, &o));
>  }
>
>  /*


More information about the svn-src-all mailing list