summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-05-11 20:05:43 +0000
committerjbj <devnull@localhost>1999-05-11 20:05:43 +0000
commitac640010ef52ece0f125d2bded78ff91f1a5ef7e (patch)
tree5ee7af72c897f3371eeacd8bfc38409ab396ab5f /lib
parentc276bd3827ce05f8fa95eca93a9afc835b2c3428 (diff)
downloadrpm-ac640010ef52ece0f125d2bded78ff91f1a5ef7e.tar.gz
rpm-ac640010ef52ece0f125d2bded78ff91f1a5ef7e.tar.bz2
rpm-ac640010ef52ece0f125d2bded78ff91f1a5ef7e.zip
better cpio error message if package contains missing hard links.
CVS patchset: 3058 CVS date: 1999/05/11 20:05:43
Diffstat (limited to 'lib')
-rw-r--r--lib/cpio.c8
-rw-r--r--lib/cpio.h7
2 files changed, 8 insertions, 7 deletions
diff --git a/lib/cpio.c b/lib/cpio.c
index 78c4a51c1..0a2543e29 100644
--- a/lib/cpio.c
+++ b/lib/cpio.c
@@ -583,7 +583,6 @@ int cpioInstallArchive(CFD_t *cfd, struct cpioFileMapping * mappings,
to create those anyway */
if (S_ISREG(ch.mode) && ch.nlink > 1) {
- li = links;
for (li = links; li; li = li->next) {
if (li->inode == ch.inode && li->dev == ch.dev) break;
}
@@ -636,7 +635,7 @@ int cpioInstallArchive(CFD_t *cfd, struct cpioFileMapping * mappings,
/* this mimicks cpio but probably isnt' right */
rc = expandFifo(cfd, &ch);
} else {
- rc = CPIOERR_INTERNAL;
+ rc = CPIOERR_UNKNOWN_FILETYPE;
}
}
@@ -677,7 +676,7 @@ int cpioInstallArchive(CFD_t *cfd, struct cpioFileMapping * mappings,
while (li && !rc) {
if (li->linksLeft) {
if (li->createdPath == -1)
- rc = CPIOERR_INTERNAL;
+ rc = CPIOERR_MISSING_HARDLINK;
else
rc = createLinks(li, failedFile);
}
@@ -1019,9 +1018,10 @@ const char * cpioStrerror(int rc)
case CPIOERR_READ_FAILED: s = "read"; break;
case CPIOERR_COPY_FAILED: s = "copy"; break;
- case CPIOERR_INTERNAL: s = _("Internal error"); break;
case CPIOERR_HDR_SIZE: s = _("Header size too big"); break;
case CPIOERR_UNKNOWN_FILETYPE: s = _("Unknown file type"); break;
+ case CPIOERR_MISSING_HARDLINK: s = _("Missing hard link"); break;
+ case CPIOERR_INTERNAL: s = _("Internal error"); break;
}
l = sizeof(msg) - strlen(msg) - 1;
diff --git a/lib/cpio.h b/lib/cpio.h
index 16a97b595..4386cc562 100644
--- a/lib/cpio.h
+++ b/lib/cpio.h
@@ -28,9 +28,10 @@
#define CPIOERR_READLINK_FAILED (17 | CPIOERR_CHECK_ERRNO)
#define CPIOERR_READ_FAILED (18 | CPIOERR_CHECK_ERRNO)
#define CPIOERR_COPY_FAILED (19 | CPIOERR_CHECK_ERRNO)
-#define CPIOERR_INTERNAL (20 )
-#define CPIOERR_HDR_SIZE (21 )
-#define CPIOERR_UNKNOWN_FILETYPE (22 )
+#define CPIOERR_HDR_SIZE (20 )
+#define CPIOERR_UNKNOWN_FILETYPE (21 )
+#define CPIOERR_MISSING_HARDLINK (22 )
+#define CPIOERR_INTERNAL (23 )
/* Don't think this behaves just like standard cpio. It's pretty close, but