mirror of
https://github.com/sheumann/hush.git
synced 2025-02-28 20:31:33 +00:00
= minor formatting issues
This commit is contained in:
parent
7cdc76dfbf
commit
eb0283333b
@ -361,16 +361,15 @@ const struct BB_applet applets[] = {
|
|||||||
#ifdef BB_FEATURE_INSTALLER
|
#ifdef BB_FEATURE_INSTALLER
|
||||||
/*
|
/*
|
||||||
* directory table
|
* directory table
|
||||||
* this should be consistent w/ the enum, internal.h::Location,
|
* this should be consistent w/ the enum, internal.h::Location,
|
||||||
* or else...
|
* or else...
|
||||||
*/
|
*/
|
||||||
static char* install_dir[] = {
|
static char* install_dir[] = {
|
||||||
"/",
|
"/",
|
||||||
"/bin",
|
"/bin",
|
||||||
"/sbin",
|
"/sbin",
|
||||||
"/usr/bin",
|
"/usr/bin",
|
||||||
"/usr/sbin",
|
"/usr/sbin",
|
||||||
NULL
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* abstract link() */
|
/* abstract link() */
|
||||||
@ -384,10 +383,10 @@ typedef int (*__link_f)(const char *, const char *);
|
|||||||
*/
|
*/
|
||||||
static char *busybox_fullpath()
|
static char *busybox_fullpath()
|
||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
char path[256];
|
char path[256];
|
||||||
char proc[256];
|
char proc[256];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
pid = getpid();
|
pid = getpid();
|
||||||
sprintf(proc, "/proc/%d/exe", pid);
|
sprintf(proc, "/proc/%d/exe", pid);
|
||||||
@ -404,30 +403,30 @@ static char *busybox_fullpath()
|
|||||||
/* create (sym)links for each applet */
|
/* create (sym)links for each applet */
|
||||||
static int install_links(const char *busybox, int use_symbolic_links)
|
static int install_links(const char *busybox, int use_symbolic_links)
|
||||||
{
|
{
|
||||||
__link_f Link = link;
|
__link_f Link = link;
|
||||||
|
|
||||||
char command[256];
|
char command[256];
|
||||||
int i;
|
int i;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
if (use_symbolic_links) Link = symlink;
|
if (use_symbolic_links) Link = symlink;
|
||||||
|
|
||||||
for (i = 0; applets[i].name != NULL; i++) {
|
for (i = 0; applets[i].name != NULL; i++) {
|
||||||
sprintf (
|
sprintf (
|
||||||
command,
|
command,
|
||||||
"%s/%s",
|
"%s/%s",
|
||||||
install_dir[applets[i].location],
|
install_dir[applets[i].location],
|
||||||
applets[i].name
|
applets[i].name
|
||||||
);
|
);
|
||||||
#if 1
|
#if 1
|
||||||
rc |= Link(busybox, command);
|
rc |= Link(busybox, command);
|
||||||
#else
|
#else
|
||||||
puts(command);
|
puts(command);
|
||||||
#endif
|
#endif
|
||||||
if (rc) {
|
if (rc) {
|
||||||
fprintf(stderr,"busybox : %s : %s\n", command, strerror(errno));
|
fprintf(stderr,"busybox : %s : %s\n", command, strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
41
busybox.c
41
busybox.c
@ -361,16 +361,15 @@ const struct BB_applet applets[] = {
|
|||||||
#ifdef BB_FEATURE_INSTALLER
|
#ifdef BB_FEATURE_INSTALLER
|
||||||
/*
|
/*
|
||||||
* directory table
|
* directory table
|
||||||
* this should be consistent w/ the enum, internal.h::Location,
|
* this should be consistent w/ the enum, internal.h::Location,
|
||||||
* or else...
|
* or else...
|
||||||
*/
|
*/
|
||||||
static char* install_dir[] = {
|
static char* install_dir[] = {
|
||||||
"/",
|
"/",
|
||||||
"/bin",
|
"/bin",
|
||||||
"/sbin",
|
"/sbin",
|
||||||
"/usr/bin",
|
"/usr/bin",
|
||||||
"/usr/sbin",
|
"/usr/sbin",
|
||||||
NULL
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* abstract link() */
|
/* abstract link() */
|
||||||
@ -384,10 +383,10 @@ typedef int (*__link_f)(const char *, const char *);
|
|||||||
*/
|
*/
|
||||||
static char *busybox_fullpath()
|
static char *busybox_fullpath()
|
||||||
{
|
{
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
char path[256];
|
char path[256];
|
||||||
char proc[256];
|
char proc[256];
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
pid = getpid();
|
pid = getpid();
|
||||||
sprintf(proc, "/proc/%d/exe", pid);
|
sprintf(proc, "/proc/%d/exe", pid);
|
||||||
@ -404,30 +403,30 @@ static char *busybox_fullpath()
|
|||||||
/* create (sym)links for each applet */
|
/* create (sym)links for each applet */
|
||||||
static int install_links(const char *busybox, int use_symbolic_links)
|
static int install_links(const char *busybox, int use_symbolic_links)
|
||||||
{
|
{
|
||||||
__link_f Link = link;
|
__link_f Link = link;
|
||||||
|
|
||||||
char command[256];
|
char command[256];
|
||||||
int i;
|
int i;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
if (use_symbolic_links) Link = symlink;
|
if (use_symbolic_links) Link = symlink;
|
||||||
|
|
||||||
for (i = 0; applets[i].name != NULL; i++) {
|
for (i = 0; applets[i].name != NULL; i++) {
|
||||||
sprintf (
|
sprintf (
|
||||||
command,
|
command,
|
||||||
"%s/%s",
|
"%s/%s",
|
||||||
install_dir[applets[i].location],
|
install_dir[applets[i].location],
|
||||||
applets[i].name
|
applets[i].name
|
||||||
);
|
);
|
||||||
#if 1
|
#if 1
|
||||||
rc |= Link(busybox, command);
|
rc |= Link(busybox, command);
|
||||||
#else
|
#else
|
||||||
puts(command);
|
puts(command);
|
||||||
#endif
|
#endif
|
||||||
if (rc) {
|
if (rc) {
|
||||||
fprintf(stderr,"busybox : %s : %s\n", command, strerror(errno));
|
fprintf(stderr,"busybox : %s : %s\n", command, strerror(errno));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user