Some provision for handling Rock-Ridge device numbers.

This commit is contained in:
rocky
2005-10-04 09:59:46 +00:00
parent f9f6561478
commit 01a86fd79d
2 changed files with 13 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
/* /*
$Id: rock.h,v 1.10 2005/09/15 06:36:01 rocky Exp $ $Id: rock.h,v 1.11 2005/10/04 09:59:46 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
@@ -318,6 +318,9 @@ typedef struct iso_rock_statbuf_s {
9660:9.5.6. */ 9660:9.5.6. */
iso_rock_time_t effective; /**< Effective time; See ISO 9660:9.5.7. iso_rock_time_t effective; /**< Effective time; See ISO 9660:9.5.7.
*/ */
uint32_t i_rdev; /**< the upper 16-bits is major device
number, the lower 16-bits is the
minor device number */
} iso_rock_statbuf_t; } iso_rock_statbuf_t;

View File

@@ -1,5 +1,5 @@
/* /*
$Id: rock.c,v 1.13 2005/02/26 17:54:49 rocky Exp $ $Id: rock.c,v 1.14 2005/10/04 09:59:46 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com> Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
Adapted from GNU/Linux fs/isofs/rock.c (C) 1992, 1993 Eric Youngdale Adapted from GNU/Linux fs/isofs/rock.c (C) 1992, 1993 Eric Youngdale
@@ -41,6 +41,8 @@
#include <cdio/logging.h> #include <cdio/logging.h>
#include <cdio/bytesex.h> #include <cdio/bytesex.h>
#define CDIO_MKDEV(ma,mi) ((ma)<<16 | (mi))
enum iso_rock_enums iso_rock_enums; enum iso_rock_enums iso_rock_enums;
iso_rock_nm_flag_t iso_rock_nm_flag; iso_rock_nm_flag_t iso_rock_nm_flag;
iso_rock_sl_flag_t iso_rock_sl_flag; iso_rock_sl_flag_t iso_rock_sl_flag;
@@ -365,11 +367,11 @@ parse_rock_ridge_stat_internal(iso9660_dir_t *p_iso9660_dir,
p_stat->rr.st_uid = from_733(rr->u.PX.st_uid); p_stat->rr.st_uid = from_733(rr->u.PX.st_uid);
p_stat->rr.st_gid = from_733(rr->u.PX.st_gid); p_stat->rr.st_gid = from_733(rr->u.PX.st_gid);
break; break;
#ifdef DEV_FINISHED
case SIG('P','N'): case SIG('P','N'):
{ int high, low; /* Device major,minor number */
high = from_733(*rr->u.PN.dev_high); { int32_t high, low;
low = from_733(*rr->u.PN.dev_low); high = from_733(rr->u.PN.dev_high);
low = from_733(rr->u.PN.dev_low);
/* /*
* The Rock Ridge standard specifies that if sizeof(dev_t) <= 4, * The Rock Ridge standard specifies that if sizeof(dev_t) <= 4,
* then the high field is unused, and the device number is completely * then the high field is unused, and the device number is completely
@@ -378,13 +380,12 @@ parse_rock_ridge_stat_internal(iso9660_dir_t *p_iso9660_dir,
* stored in the low field, and use that. * stored in the low field, and use that.
*/ */
if((low & ~0xff) && high == 0) { if((low & ~0xff) && high == 0) {
p_stat->rr.i_rdev = MKDEV(low >> 8, low & 0xff); p_stat->rr.i_rdev = CDIO_MKDEV(low >> 8, low & 0xff);
} else { } else {
p_stat->rr.i_rdev = MKDEV(high, low); p_stat->rr.i_rdev = CDIO_MKDEV(high, low);
} }
} }
break; break;
#endif
case SIG('T','F'): case SIG('T','F'):
/* Time stamp(s) for a file */ /* Time stamp(s) for a file */
{ {