summaryrefslogtreecommitdiffstats
path: root/common/blspec.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-05-09 08:49:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-05-09 08:49:42 +0200
commit55aca0a48c5cb68eeddf723a5bc69fc052071e61 (patch)
tree00961bee994725f5d3ee678c5630b53ecc5a02fe /common/blspec.c
parent216f412ede9cb78ccdfd00df89246ab1ffc9e300 (diff)
parent18f0d2221a4c781dad2a224f8ac17e7c95fd1d9c (diff)
downloadbarebox-55aca0a48c5cb68eeddf723a5bc69fc052071e61.tar.gz
Merge branch 'for-next/include-cleanup'
Diffstat (limited to 'common/blspec.c')
-rw-r--r--common/blspec.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/common/blspec.c b/common/blspec.c
index ac8f512..bf98e6b 100644
--- a/common/blspec.c
+++ b/common/blspec.c
@@ -203,16 +203,18 @@ static char *parse_nfs_url(const char *url)
if (ip == 0)
goto out;
- hostpath = asprintf("%s:%s", ip_to_string(ip), path);
+ hostpath = basprintf("%s:%s", ip_to_string(ip), path);
prevpath = nfs_find_mountpath(hostpath);
if (prevpath) {
mountpath = xstrdup(prevpath);
} else {
- mountpath = asprintf("/mnt/nfs-%s-blspec-%08x", host, rand());
+ mountpath = basprintf("/mnt/nfs-%s-blspec-%08x", host,
+ rand());
if (port)
- options = asprintf("mountport=%s,port=%s", port, port);
+ options = basprintf("mountport=%s,port=%s", port,
+ port);
ret = make_directory(mountpath);
if (ret)
@@ -278,7 +280,7 @@ static bool entry_is_of_compatible(struct blspec_entry *entry)
if (!strcmp(devicetree, "none"))
return true;
- filename = asprintf("%s/%s", abspath, devicetree);
+ filename = basprintf("%s/%s", abspath, devicetree);
fdt = read_file(filename, &size);
if (!fdt) {
@@ -338,7 +340,7 @@ int blspec_scan_directory(struct blspec *blspec, const char *root)
entry_default = read_file_line("%s/default", root);
entry_once = read_file_line("%s/once", root);
- abspath = asprintf("%s/%s", root, dirname);
+ abspath = basprintf("%s/%s", root, dirname);
dir = opendir(abspath);
if (!dir) {
@@ -356,7 +358,7 @@ int blspec_scan_directory(struct blspec *blspec, const char *root)
if (*d->d_name == '.')
continue;
- configname = asprintf("%s/%s", abspath, d->d_name);
+ configname = basprintf("%s/%s", abspath, d->d_name);
dot = strrchr(configname, '.');
if (!dot) {
@@ -402,7 +404,7 @@ int blspec_scan_directory(struct blspec *blspec, const char *root)
found++;
- name = asprintf("%s/%s", dirname, d->d_name);
+ name = basprintf("%s/%s", dirname, d->d_name);
if (entry_default && !strcmp(name, entry_default))
entry->boot_default = true;
if (entry_once && !strcmp(name, entry_once))
@@ -415,10 +417,10 @@ int blspec_scan_directory(struct blspec *blspec, const char *root)
hwdevname = xstrdup(dev_name(entry->cdev->dev->parent));
}
- entry->me.display = asprintf("%-20s %-20s %s",
- devname ? devname : "",
- hwdevname ? hwdevname : "",
- blspec_entry_var_get(entry, "title"));
+ entry->me.display = basprintf("%-20s %-20s %s",
+ devname ? devname : "",
+ hwdevname ? hwdevname : "",
+ blspec_entry_var_get(entry, "title"));
free(devname);
free(hwdevname);
@@ -669,7 +671,7 @@ int blspec_boot(struct blspec_entry *entry, int verbose, int dryrun)
else
abspath = "";
- data.os_file = asprintf("%s/%s", abspath, linuximage);
+ data.os_file = basprintf("%s/%s", abspath, linuximage);
if (devicetree) {
if (!strcmp(devicetree, "none")) {
@@ -677,13 +679,13 @@ int blspec_boot(struct blspec_entry *entry, int verbose, int dryrun)
if (node)
of_delete_node(node);
} else {
- data.oftree_file = asprintf("%s/%s", abspath,
- devicetree);
+ data.oftree_file = basprintf("%s/%s", abspath,
+ devicetree);
}
}
if (initrd)
- data.initrd_file = asprintf("%s/%s", abspath, initrd);
+ data.initrd_file = basprintf("%s/%s", abspath, initrd);
globalvar_add_simple("linux.bootargs.dyn.blspec", options);
@@ -704,7 +706,7 @@ int blspec_boot(struct blspec_entry *entry, int verbose, int dryrun)
entry->cdev ? dev_name(entry->cdev->dev) : "none");
if (entry->boot_once) {
- char *s = asprintf("%s/once", abspath);
+ char *s = basprintf("%s/once", abspath);
ret = unlink(s);
if (ret)