[BusyBox] [patch] ifupdown / run parts

Vladimir N. Oleynik dzo at simtreas.ru
Mon Jul 28 13:00:45 UTC 2003


Bruno,

> -	buf = xmalloc(bb_strlen(opt) + 19);
> -	sprintf(buf, "/etc/network/if-%s.d", opt);
> -	run_parts(&buf, 2);
> -	free(buf);
> +	buf[0] = xmalloc(bb_strlen(opt) + 19);
> +	sprintf(buf[0], "/etc/network/if-%s.d", opt);
> +	buf[1] = NULL;
> +
> +	run_parts(&buf, 2, environ);
> +	free(buf[0]);

You can simplify this if use:

+ 	bb_xasprintf(&buf[0], "/etc/network/if-%s.d", opt);
+	buf[1] = NULL;
+
+	run_parts(&buf, 2, environ);
+	free(buf[0]);


--w
vodz




More information about the busybox mailing list