Re: [PATCH 4/11] checktty: Use EXIT_*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 01, 2010 at 05:18:02PM +0100, Marek Polacek wrote:
>  login-utils/checktty.c |   46
> +++++++++++++++++++++++-----------------------
>  1 files changed, 23 insertions(+), 23 deletions(-)

 Applied a different version.

> 
> diff --git a/login-utils/checktty.c b/login-utils/checktty.c
> index 92bebfb..b8f9001 100644
> --- a/login-utils/checktty.c
> +++ b/login-utils/checktty.c
> @@ -69,10 +69,10 @@ am_in_group(char *group)
>  	g = getgrnam(group);
>  	if (g) {
>  		for (ge = mygroups; ge < mygroups + num_groups; ge++) {
> -			if (g->gr_gid== *ge) return 1;
> +			if (g->gr_gid== *ge) return EXIT_FAILURE;
>  		}
>  	}
> -    	return 0;
> +    	return EXIT_SUCCESS;
>  }

 It does not make sense to use EXIT_* macros for "return" in normal
 functions. These macros should be used for exit() or return in
 main().

    Karel


-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux