summaryrefslogtreecommitdiffstats
path: root/usr.sbin/makefs/cd9660.c
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2012-01-31 00:32:37 +0000
committerjkim <jkim@FreeBSD.org>2012-01-31 00:32:37 +0000
commita7ddcadb12aee8630a0a25acff174bce79a7071e (patch)
treec52c0b3a46d9f152a9ca83cf598020ed44cd62fd /usr.sbin/makefs/cd9660.c
parent52801b5562a08eb59e74be5bcae14bdb70311c39 (diff)
downloadFreeBSD-src-a7ddcadb12aee8630a0a25acff174bce79a7071e.zip
FreeBSD-src-a7ddcadb12aee8630a0a25acff174bce79a7071e.tar.gz
Allow contents of multiple directories to be merged to the current image.
Note this patch was submitted to NetBSD and they already adopted it. http://mail-index.netbsd.org/source-changes/2012/01/28/msg031078.html MFC after: 1 week
Diffstat (limited to 'usr.sbin/makefs/cd9660.c')
-rw-r--r--usr.sbin/makefs/cd9660.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c
index 5d207c7..2b33446 100644
--- a/usr.sbin/makefs/cd9660.c
+++ b/usr.sbin/makefs/cd9660.c
@@ -472,8 +472,6 @@ cd9660_makefs(const char *image, const char *dir, fsnode *root,
return;
}
- diskStructure.rootFilesystemPath = dir;
-
if (diskStructure.verbose_level > 0)
printf("cd9660_makefs: image %s directory %s root %p\n",
image, dir, root);
@@ -1568,24 +1566,15 @@ cd9660_generate_path_table(void)
}
void
-cd9660_compute_full_filename(cd9660node *node, char *buf, int level)
+cd9660_compute_full_filename(cd9660node *node, char *buf)
{
- cd9660node *parent;
-
- parent = (node->rr_real_parent == NULL ?
- node->parent : node->rr_real_parent);
- if (parent != NULL) {
- cd9660_compute_full_filename(parent, buf, level + 1);
- strcat(buf, node->node->name);
- } else {
- /* We are at the root */
- strcat(buf, diskStructure.rootFilesystemPath);
- if (buf[strlen(buf) - 1] == '/')
- buf[strlen(buf) - 1] = '\0';
- }
+ int len;
- if (level != 0)
- strcat(buf, "/");
+ len = CD9660MAXPATH + 1;
+ len = snprintf(buf, len, "%s/%s/%s", node->node->root,
+ node->node->path, node->node->name);
+ if (len > CD9660MAXPATH)
+ errx(1, "Pathname too long.");
}
/* NEW filename conversion method */
OpenPOWER on IntegriCloud