]> Zhao Yanbai Git Server - minix.git/commitdiff
makefs: apply NetBSD PR kern/48852 patch 88/2988/2
authorJean-Baptiste Boric <jblbeurope@gmail.com>
Thu, 23 Apr 2015 15:30:57 +0000 (17:30 +0200)
committerLionel Sambuc <lionel.sambuc@gmail.com>
Wed, 7 Oct 2015 10:40:05 +0000 (12:40 +0200)
It's a fix for correcting cd9660 device node creation in makefs. This
fix was commited in NetBSD on May 30, 2014, after the current NetBSD
source code import, hence the cherrypicking.

Change-Id: Id3e05618688bbd6d07780f46f6ada90525556b5a

usr.sbin/makefs/cd9660/iso9660_rrip.c

index 9189be0494e0f8991be80052755595e74d53cfa7..9f7170dff81adcd6b3b92b6b04b3bc373a1ac4f0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: iso9660_rrip.c,v 1.13 2013/07/30 16:02:23 reinoud Exp $        */
+/*     $NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $ */
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -44,7 +44,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: iso9660_rrip.c,v 1.13 2013/07/30 16:02:23 reinoud Exp $");
+__RCSID("$NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $");
 #endif  /* !__lint */
 
 static void cd9660_rrip_initialize_inode(cd9660node *);
@@ -657,13 +657,14 @@ cd9660node_rrip_pn(struct ISO_SUSP_ATTRIBUTES *pn_field, fsnode *fnode)
        pn_field->attr.rr_entry.PN.h.length[0] = 20;
        pn_field->attr.rr_entry.PN.h.version[0] = 1;
 
-       if (sizeof (fnode->inode->st.st_dev) > 32)
-               cd9660_bothendian_dword((uint64_t)fnode->inode->st.st_dev >> 32,
+       if (sizeof (fnode->inode->st.st_rdev) > 4)
+               cd9660_bothendian_dword(
+                   (uint64_t)fnode->inode->st.st_rdev >> 32,
                    pn_field->attr.rr_entry.PN.high);
        else
                cd9660_bothendian_dword(0, pn_field->attr.rr_entry.PN.high);
 
-       cd9660_bothendian_dword(fnode->inode->st.st_dev & 0xffffffff,
+       cd9660_bothendian_dword(fnode->inode->st.st_rdev & 0xffffffff,
                pn_field->attr.rr_entry.PN.low);
        return 1;
 }