diff options
| author | christos <christos@NetBSD.org> | 2015-12-21 03:19:17 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2015-12-21 03:19:17 +0000 |
| commit | 23ea789e7dcecfcbf4e280487e46cf1dae0a6d2a (patch) | |
| tree | fe61b09aa2704b553e8a166ada5508f7b6b2e628 /usr.sbin | |
| parent | c7d9be2e5daf4f8b0d6dc6e24051e8b47a482274 (diff) | |
Fix some more MKREPRO issues in cdrom creation. Now amd64 passes MKREPRO.
Diffstat (limited to 'usr.sbin')
| -rw-r--r-- | usr.sbin/makefs/cd9660.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c index be733c4257a..1a517b733cc 100644 --- a/usr.sbin/makefs/cd9660.c +++ b/usr.sbin/makefs/cd9660.c @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660.c,v 1.50 2015/11/25 00:48:49 christos Exp $ */ +/* $NetBSD: cd9660.c,v 1.51 2015/12/21 03:19:17 christos Exp $ */ /* * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan @@ -103,7 +103,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(__lint) -__RCSID("$NetBSD: cd9660.c,v 1.50 2015/11/25 00:48:49 christos Exp $"); +__RCSID("$NetBSD: cd9660.c,v 1.51 2015/12/21 03:19:17 christos Exp $"); #endif /* !__lint */ #include <string.h> @@ -483,7 +483,7 @@ cd9660_parse_opts(const char *option, fsinfo_t *fsopts) */ void cd9660_makefs(const char *image, const char *dir, fsnode *root, - fsinfo_t *fsopts) + fsinfo_t *fsopts) { int64_t startoffset; int numDirectories; @@ -661,7 +661,7 @@ typedef int (*cd9660node_func)(cd9660node *); static void cd9660_finalize_PVD(iso9660_disk *diskStructure) { - time_t tim; + time_t tstamp = stampst.st_ino ? stampst.st_mtime : time(NULL); /* root should be a fixed size of 34 bytes since it has no name */ memcpy(diskStructure->primaryDescriptor.root_directory_record, @@ -710,23 +710,23 @@ cd9660_finalize_PVD(iso9660_disk *diskStructure) diskStructure->primaryDescriptor.bibliographic_file_id, 37); /* Setup dates */ - time(&tim); cd9660_time_8426( (unsigned char *)diskStructure->primaryDescriptor.creation_date, - tim); + tstamp); cd9660_time_8426( (unsigned char *)diskStructure->primaryDescriptor.modification_date, - tim); + tstamp); - /* - cd9660_set_date(diskStructure->primaryDescriptor.expiration_date, now); - */ +#if 0 + cd9660_set_date(diskStructure->primaryDescriptor.expiration_date, + tstamp); +#endif memset(diskStructure->primaryDescriptor.expiration_date, '0' ,16); diskStructure->primaryDescriptor.expiration_date[16] = 0; cd9660_time_8426( (unsigned char *)diskStructure->primaryDescriptor.effective_date, - tim); + tstamp); } static void @@ -821,7 +821,7 @@ cd9660_fill_extended_attribute_record(cd9660node *node) static int cd9660_translate_node_common(iso9660_disk *diskStructure, cd9660node *newnode) { - time_t tim; + time_t tstamp = stampst.st_ino ? stampst.st_mtime : time(NULL); u_char flag; char temp[ISO_FILENAME_MAXLENGTH_WITH_PADDING]; @@ -841,9 +841,8 @@ cd9660_translate_node_common(iso9660_disk *diskStructure, cd9660node *newnode) /* Set the various dates */ /* If we want to use the current date and time */ - time(&tim); - cd9660_time_915(newnode->isoDirRecord->date, tim); + cd9660_time_915(newnode->isoDirRecord->date, tstamp); cd9660_bothendian_dword(newnode->fileDataLength, newnode->isoDirRecord->size); @@ -883,7 +882,8 @@ cd9660_translate_node(iso9660_disk *diskStructure, fsnode *node, return 0; /* Finally, overwrite some of the values that are set by default */ - cd9660_time_915(newnode->isoDirRecord->date, node->inode->st.st_mtime); + cd9660_time_915(newnode->isoDirRecord->date, + stampst.st_ino ? stampst.st_mtime : node->inode->st.st_mtime); return 1; } |
