summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-09-29 19:30:24 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2010-09-30 08:54:52 +0300
commit7ef8be0c719b86a224896a9ce03b9ac9bcc45e60 (patch)
treed2491b61f3a704e2bf3a4c2074c790e2f4ec17a2
parent7a44e55045954ea0af06ab98ccfb41b18c1747f2 (diff)
mkfs.jffs2: use new xasprintf() helper
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
-rw-r--r--mkfs.jffs2.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mkfs.jffs2.c b/mkfs.jffs2.c
index 1ea3598..528a7fe 100644
--- a/mkfs.jffs2.c
+++ b/mkfs.jffs2.c
@@ -391,14 +391,14 @@ static struct filesystem_entry *recursive_add_host_directory(
continue;
}
- asprintf(&hpath, "%s/%s", hostpath, dp->d_name);
+ xasprintf(&hpath, "%s/%s", hostpath, dp->d_name);
if (lstat(hpath, &sb)) {
perror_msg_and_die("%s", hpath);
}
if (strcmp(targetpath, "/") == 0) {
- asprintf(&tpath, "%s%s", targetpath, dp->d_name);
+ xasprintf(&tpath, "%s%s", targetpath, dp->d_name);
} else {
- asprintf(&tpath, "%s/%s", targetpath, dp->d_name);
+ xasprintf(&tpath, "%s/%s", targetpath, dp->d_name);
}
switch (sb.st_mode & S_IFMT) {
@@ -489,7 +489,7 @@ static int interpret_table_entry(struct filesystem_entry *root, char *line)
error_msg_and_die("Device table entries require absolute paths");
}
- asprintf(&hostpath, "%s%s", rootdir, name);
+ xasprintf(&hostpath, "%s%s", rootdir, name);
/* Check if this file already exists... */
switch (type) {
@@ -556,8 +556,8 @@ static int interpret_table_entry(struct filesystem_entry *root, char *line)
char *dname, *hpath;
for (i = start; i < count; i++) {
- asprintf(&dname, "%s%lu", name, i);
- asprintf(&hpath, "%s/%s%lu", rootdir, name, i);
+ xasprintf(&dname, "%s%lu", name, i);
+ xasprintf(&hpath, "%s/%s%lu", rootdir, name, i);
rdev = makedev(major, minor + (i * increment - start));
add_host_filesystem_entry(dname, hpath, uid, gid,
mode, rdev, parent);