Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/makefs Move date setting into cd9660_populate_iso_d...



details:   https://anonhg.NetBSD.org/src/rev/07269bc2bcae
branches:  trunk
changeset: 374329:07269bc2bcae
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Apr 18 23:05:51 2023 +0000

description:
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:

 usr.sbin/makefs/cd9660.c |  14 +++++---------
 1 files changed, 5 insertions(+), 9 deletions(-)

diffs (50 lines):

diff -r 2c3662374428 -r 07269bc2bcae usr.sbin/makefs/cd9660.c
--- a/usr.sbin/makefs/cd9660.c  Tue Apr 18 23:02:51 2023 +0000
+++ b/usr.sbin/makefs/cd9660.c  Tue Apr 18 23:05:51 2023 +0000
@@ -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 */



Home | Main Index | Thread Index | Old Index