Adaptions to FreeBSD. Thanks to J.R. Oldroyd.

This commit is contained in:
Thomas Schmitt 2008-11-15 13:37:54 +00:00
parent 6757a864a6
commit 72e6ee6dd2
2 changed files with 12 additions and 4 deletions

View File

@ -89,6 +89,7 @@ or
#include <utime.h>
#include <pwd.h>
#include <grp.h>
#include <signal.h>
/* for -charset */
#include <iconv.h>
@ -7842,7 +7843,7 @@ int Xorriso__mode_to_perms(mode_t st_mode, char perms[10], int flag)
*/
int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag)
{
int show_major_minor= 0;
int show_major_minor= 0, high_shift= 0, high_mask= 0;
char *rpt, perms[10], mm_text[80];
mode_t st_mode;
dev_t dev, major, minor;
@ -7883,8 +7884,15 @@ int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag)
dev= stbuf->st_rdev;
/* according to /usr/include/sys/sysmacros.h : gnu_dev_major(),_minor()
>>> but this looks should go to some system dependency */
major= (((dev >> 8) & 0xfff) | ((unsigned int) (dev >> 32) & ~0xfff))
>>> but this looks as if it should go to some system dependency
>>> in FreeBSD dev_t is 32 bit
*/
if(sizeof(dev_t) > 4) {
high_shift= 32;
high_mask= ~0xfff;
}
major= (((dev >> 8) & 0xfff) |
((unsigned int) (dev >> high_shift) & high_mask))
& 0xffffffff;
minor= (((dev & 0xff) | ((unsigned int) (dev >> 12) & ~0xff))) & 0xffffffff;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.11.12.153437"
#define Xorriso_timestamP "2008.11.15.133724"