Module Name:    src
Committed By:   christos
Date:           Tue Apr 18 23:05:51 UTC 2023

Modified Files:
        src/usr.sbin/makefs: cd9660.c

Log Message:
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


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/usr.sbin/makefs/cd9660.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/cd9660.c
diff -u src/usr.sbin/makefs/cd9660.c:1.58 src/usr.sbin/makefs/cd9660.c:1.59
--- src/usr.sbin/makefs/cd9660.c:1.58	Tue Dec 21 16:28:31 2021
+++ src/usr.sbin/makefs/cd9660.c	Tue Apr 18 19:05:51 2023
@@ -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 _i
 			       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(cd
 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_dis
 	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 */

Reply via email to