Correct Rock-Ridge directory/link listing.

{cd,iso}-info --no-rock-ridge works (and with rock-ridge too)
test/*.right: output is now what I guess it's should be
This commit is contained in:
rocky
2005-02-20 16:21:06 +00:00
parent 25f560b5cf
commit 3d97c7ded6
14 changed files with 192 additions and 127 deletions

View File

@@ -1,5 +1,5 @@
/*
$Id: rock.c,v 1.5 2005/02/20 10:21:01 rocky Exp $
$Id: rock.c,v 1.6 2005/02/20 16:21:06 rocky Exp $
Copyright (C) 2005 Rocky Bernstein <rocky@panix.com>
Adapted from GNU/Linux fs/isofs/rock.c (C) 1992, 1993 Eric Youngdale
@@ -33,6 +33,10 @@
# include <stdlib.h>
#endif
#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
#include <cdio/iso9660.h>
#include <cdio/logging.h>
#include <cdio/bytesex.h>
@@ -452,17 +456,17 @@ iso9660_get_rock_attr_str(posix_mode_t st_mode)
{
char *result = _getbuf();
if (st_mode & ISO_ROCK_ISBLK)
if (S_ISBLK(st_mode))
result[ 0] = 'b';
else if (st_mode & ISO_ROCK_ISDIR)
else if (S_ISDIR(st_mode))
result[ 0] = 'd';
else if (st_mode & ISO_ROCK_ISCHR)
else if (S_ISCHR(st_mode))
result[ 0] = 'c';
else if (st_mode & ISO_ROCK_ISLNK)
else if (S_ISLNK(st_mode))
result[ 0] = 'l';
else if (st_mode & ISO_ROCK_ISFIFO)
else if (S_ISFIFO(st_mode))
result[ 0] = 'p';
else if (st_mode & ISO_ROCK_ISSOCK)
else if (S_ISSOCK(st_mode))
result[ 0] = 's';
/* May eventually fill in others.. */
else