Synced -lsl display of major,minor numbers with /usr/include/sys/sysmacros.h

This commit is contained in:
Thomas Schmitt 2008-08-21 07:07:23 +00:00
parent fbc3e6992c
commit 6eef826c60
2 changed files with 11 additions and 3 deletions

View File

@ -6882,6 +6882,7 @@ int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag)
int show_major_minor= 0;
char *rpt, perms[10], mm_text[80];
mode_t st_mode;
dev_t dev, major, minor;
rpt= xorriso->result_line;
rpt[0]= 0;
@ -6914,8 +6915,15 @@ int Xorriso_format_ls_l(struct XorrisO *xorriso, struct stat *stbuf, int flag)
sprintf(rpt+strlen(rpt), "%-8lu ", (unsigned long) stbuf->st_uid);
sprintf(rpt+strlen(rpt), "%-8lu ", (unsigned long) stbuf->st_gid);
if(show_major_minor) {
sprintf(mm_text, "%d,%d", (int) ((stbuf->st_rdev>>8)&0xfff),
(int) (((stbuf->st_rdev&~0xfffff)>>12) | (stbuf->st_rdev&0xff)));
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))
& 0xffffffff;
minor= (((dev & 0xff) | ((unsigned int) (dev >> 12) & ~0xff))) & 0xffffffff;
sprintf(mm_text, "%u,%u", (unsigned int) major, (unsigned int) minor);
sprintf(rpt+strlen(rpt), "%8s ", mm_text);
} else
sprintf(rpt+strlen(rpt), "%8.f ", (double) stbuf->st_size);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2008.08.20.181734"
#define Xorriso_timestamP "2008.08.21.070602"