summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2023-04-18 23:05:51 +0000
committerchristos <christos@NetBSD.org>2023-04-18 23:05:51 +0000
commit47cdec7821eb33d53c06a8237c36c0e501b1432f (patch)
treeee12009566239f834daa562ccc6d1e09d9361ec0 /usr.sbin
parentf9741bf1178a53a0fb54e9b2e0545440d0ba6213 (diff)
Move date setting into cd9660_populate_iso_dir_record so there is no
path that leaves it unset. From FreeBSD https://reviews.freebsd.org/D39258
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/makefs/cd9660.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/usr.sbin/makefs/cd9660.c b/usr.sbin/makefs/cd9660.c
index e1778635bfc..c01a90a0809 100644
--- a/usr.sbin/makefs/cd9660.c
+++ b/usr.sbin/makefs/cd9660.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660.c,v 1.58 2021/12/21 21:28:31 andvar Exp $ */
+/* $NetBSD: cd9660.c,v 1.59 2023/04/18 23:05:51 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.58 2021/12/21 21:28:31 andvar Exp $");
+__RCSID("$NetBSD: cd9660.c,v 1.59 2023/04/18 23:05:51 christos Exp $");
#endif /* !__lint */
#include <string.h>
@@ -737,7 +737,10 @@ cd9660_populate_iso_dir_record(struct _iso_directory_record_cd9660 *record,
u_char ext_attr_length, u_char flags,
u_char name_len, const char * name)
{
+ time_t tstamp = stampst.st_ino ? stampst.st_mtime : time(NULL);
+
record->ext_attr_length[0] = ext_attr_length;
+ cd9660_time_915(record->date, tstamp);
record->flags[0] = ISO_FLAG_CLEAR | flags;
record->file_unit_size[0] = 0;
record->interleave[0] = 0;
@@ -824,7 +827,6 @@ cd9660_fill_extended_attribute_record(cd9660node *node)
static int
cd9660_translate_node_common(iso9660_disk *diskStructure, cd9660node *newnode)
{
- time_t tstamp = stampst.st_ino ? stampst.st_mtime : time(NULL);
u_char flag;
char temp[ISO_FILENAME_MAXLENGTH_WITH_PADDING];
@@ -841,12 +843,6 @@ cd9660_translate_node_common(iso9660_disk *diskStructure, cd9660node *newnode)
cd9660_populate_iso_dir_record(newnode->isoDirRecord, 0,
flag, strlen(temp), temp);
- /* Set the various dates */
-
- /* If we want to use the current date and time */
-
- cd9660_time_915(newnode->isoDirRecord->date, tstamp);
-
cd9660_bothendian_dword(newnode->fileDataLength,
newnode->isoDirRecord->size);
/* If the file is a link, we want to set the size to 0 */