Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate

things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only
had one user), clean up lots of #includes...  General cleanup pass.  What I've
been doing for the last couple days.

And it conflicts!  I've removed httpd.c from this checkin due to somebody else
touching that file.  It builds for me.  I have to catch a bus.  (Now you know
why I'm looking forward to Mercurial.)
This commit is contained in:
Rob Landley
2006-08-03 15:41:12 +00:00
parent 6dce0b6fa7
commit d921b2ecc0
143 changed files with 711 additions and 1721 deletions

View File

@@ -155,7 +155,7 @@ int e2p_edit_feature(const char *str, __u32 *compat_array, __u32 *ok_array)
unsigned int mask;
int compat_type;
buf = bb_xstrdup(str);
buf = xstrdup(str);
cp = buf;
while (cp && *cp) {
neg = 0;

View File

@@ -100,7 +100,7 @@ int e2p_edit_mntopts(const char *str, __u32 *mntopts, __u32 ok)
int neg;
unsigned int mask;
buf = bb_xstrdup(str);
buf = xstrdup(str);
cp = buf;
while (cp && *cp) {
neg = 0;

View File

@@ -33,7 +33,7 @@ char *e2p_os2string(int os_type)
else
os = "(unknown os)";
ret = bb_xstrdup(os);
ret = xstrdup(os);
return ret;
}

View File

@@ -129,7 +129,7 @@ static char *base_device(const char *device)
int len;
#endif
cp = str = bb_xstrdup(device);
cp = str = xstrdup(device);
/* Skip over /dev/; if it's not present, give up. */
if (strncmp(cp, "/dev/", 5) != 0)
@@ -544,7 +544,7 @@ static char *find_fsck(char *type)
tpl = (strncmp(type, "fsck.", 5) ? "%s/fsck.%s" : "%s/%s");
for(s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
s = bb_xasprintf(tpl, s, type);
s = xasprintf(tpl, s, type);
if (stat(s, &st) == 0) break;
free(s);
}
@@ -583,7 +583,7 @@ static int execute(const char *type, const char *device, const char *mntpt,
return ENOMEM;
memset(inst, 0, sizeof(struct fsck_instance));
prog = bb_xasprintf("fsck.%s", type);
prog = xasprintf("fsck.%s", type);
argv[0] = prog;
argc = 1;

View File

@@ -226,7 +226,7 @@ static void read_bb_file(ext2_filsys fs, badblocks_list *bb_list,
FILE *f;
errcode_t retval;
f = bb_xfopen(bad_blocks_file, "r");
f = xfopen(bad_blocks_file, "r");
retval = ext2fs_read_bb_FILE(fs, f, bb_list, invalid_block);
fclose (f);
mke2fs_error_msg_and_die(retval, "read bad blocks from list");
@@ -692,7 +692,7 @@ static void parse_extended_opts(struct ext2_super_block *sb_param,
char *buf, *token, *next, *p, *arg;
int r_usage = 0;
buf = bb_xstrdup(opts);
buf = xstrdup(opts);
for (token = buf; token && *token; token = next) {
p = strchr(token, ',');
next = 0;

View File

@@ -111,7 +111,7 @@ void parse_journal_opts(char **journal_device, int *journal_flags,
{
char *buf, *token, *next, *p, *arg;
int journal_usage = 0;
buf = bb_xstrdup(opts);
buf = xstrdup(opts);
for (token = buf; token && *token; token = next) {
p = strchr(token, ',');
next = 0;
@@ -264,7 +264,7 @@ char *e2fs_set_sbin_path(void)
/* Update our PATH to include /sbin */
#define PATH_SET "/sbin"
if (oldpath)
oldpath = bb_xasprintf("%s:%s", PATH_SET, oldpath);
oldpath = xasprintf("%s:%s", PATH_SET, oldpath);
else
oldpath = PATH_SET;
putenv (oldpath);