busybox-1.32.0/libbb/appletlib.c
static void install_links(const char *busybox, int use_symbolic_links,
		char *custom_install_dir)
{
	/* directory table
	 * this should be consistent w/ the enum,
	 * busybox.h::bb_install_loc_t, or else... */
	int (*lf)(const char *, const char *);
	char *fpc;
	const char *appname = applet_names;
	unsigned i;
	int rc;

	lf = link;
	if (use_symbolic_links)
		lf = symlink;

	for (i = 0; i < ARRAY_SIZE(applet_main); i++) {
		fpc = concat_path_file(
				custom_install_dir ? custom_install_dir : install_dir[APPLET_INSTALL_LOC(i)],
				appname);
		// debug: bb_error_msg("%slinking %s to busybox",
		//		use_symbolic_links ? "sym" : "", fpc);
		rc = lf(busybox, fpc);
		if (rc != 0 && errno != EEXIST) {
			bb_simple_perror_msg(fpc);
		}
		free(fpc);
		while (*appname++ != '\0')
			continue;
	}
}
/* create (sym)links for each applet */
create (sym)links for each applet
create ( sym ) links for each applet
static void install_links(const char *busybox, int use_symbolic_links,
		char *custom_install_dir)
{
	int (*lf)(const char *, const char *);
	char *fpc;
	const char *appname = applet_names;
	unsigned i;
	int rc;
	lf = link;
	if (use_symbolic_links)
		lf = symlink;
	for (i = 0; i < ARRAY_SIZE(applet_main); i++) {
		fpc = concat_path_file(
				custom_install_dir ? custom_install_dir : install_dir[APPLET_INSTALL_LOC(i)],
				appname);
		rc = lf(busybox, fpc);
		if (rc != 0 && errno != EEXIST) {
			bb_simple_perror_msg(fpc);
		}
		free(fpc);
		while (*appname++ != '\0')
			continue;
	}
}
static void install_links ( const char * busybox , int use_symbolic_links , char * custom_install_dir ) { int ( * lf ) ( const char * , const char * ) ; char * fpc ; const char * appname = applet_names ; unsigned i ; int rc ; lf = link ; if ( use_symbolic_links ) lf = symlink ; for ( i = 0 ; i < ARRAY_SIZE ( applet_main ) ; i ++ ) { fpc = concat_path_file ( custom_install_dir ? custom_install_dir : install_dir [ APPLET_INSTALL_LOC ( i ) ] , appname ) ; rc = lf ( busybox , fpc ) ; if ( rc != 0 && errno != EEXIST ) { bb_simple_perror_msg ( fpc ) ; } free ( fpc ) ; while ( * appname ++ != ' \0 ' ) continue ; } }
create (sym)links for each applet
create ( sym ) links for each applet
/* directory table
	 * this should be consistent w/ the enum,
	 * busybox.h::bb_install_loc_t, or else... */ // debug: bb_error_msg("%slinking %s to busybox", //		use_symbolic_links ? "sym" : "", fpc);