[OpenWrt-Devel] [PATCH] service: Support writing pidfiles

John Crispin blogic at openwrt.org
Wed Mar 2 04:12:04 EST 2016


Hi,

i like it but please ...

On 02/03/2016 10:07, Karl Palsson wrote:
> +static int
> +instance_removepid(struct service_instance *in) {
> +	if (in->pidfile) {
> +		if (unlink(in->pidfile)) {
> +			ERROR("Failed to removed pidfile: %s: %d - %s\n",
> +				in->pidfile, errno, strerror(errno));
> +			return 1;
> +		}
> +	}
> +	return 0;
> +}


rework this so that there is only 1 indent. i see several ways to do so

1) merge the 2 ifs into 1 or use a

if (!in->pidfile)
	return 0;
...

up to you, but 2 levels of indent are not needed here

	John
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list