print.c (285803) | print.c (285857) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Michael Fischbein. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#if 0 34#ifndef lint 35static char sccsid[] = "@(#)print.c 8.4 (Berkeley) 4/17/94"; 36#endif /* not lint */ 37#endif 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1989, 1993, 1994 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Michael Fischbein. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#if 0 34#ifndef lint 35static char sccsid[] = "@(#)print.c 8.4 (Berkeley) 4/17/94"; 36#endif /* not lint */ 37#endif 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/bin/ls/print.c 285803 2015-07-22 19:58:21Z allanjude $"); | 39__FBSDID("$FreeBSD: head/bin/ls/print.c 285857 2015-07-24 20:20:59Z allanjude $"); |
40 41#include <sys/param.h> 42#include <sys/stat.h> 43#include <sys/acl.h> 44 45#include <err.h> 46#include <errno.h> 47#include <fts.h> --- 139 unchanged lines hidden (view full) --- 187 dp->s_block, howmany(sp->st_blocks, blocksize)); 188 strmode(sp->st_mode, buf); 189 aclmode(buf, p); 190 np = p->fts_pointer; 191 xo_attr("value", "%03o", (int) sp->st_mode & ALLPERMS); 192 if (f_numericonly) { 193 xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", 194 buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, | 40 41#include <sys/param.h> 42#include <sys/stat.h> 43#include <sys/acl.h> 44 45#include <err.h> 46#include <errno.h> 47#include <fts.h> --- 139 unchanged lines hidden (view full) --- 187 dp->s_block, howmany(sp->st_blocks, blocksize)); 188 strmode(sp->st_mode, buf); 189 aclmode(buf, p); 190 np = p->fts_pointer; 191 xo_attr("value", "%03o", (int) sp->st_mode & ALLPERMS); 192 if (f_numericonly) { 193 xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {td:user/%-*s}{e:user/%ju} {td:group/%-*s}{e:group/%ju} ", 194 buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, |
195 dp->s_user, np->user, sp->st_uid, dp->s_group, np->group, sp->st_gid); | 195 dp->s_user, np->user, (uintmax_t)sp->st_uid, dp->s_group, np->group, (uintmax_t)sp->st_gid); |
196 } else { 197 xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {t:user/%-*s} {t:group/%-*s} ", 198 buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, 199 dp->s_user, np->user, dp->s_group, np->group); 200 } 201 if (S_ISBLK(sp->st_mode)) 202 asprintf(&type, "block"); 203 if (S_ISCHR(sp->st_mode)) --- 277 unchanged lines hidden (view full) --- 481 return (1); 482 case S_IFLNK: 483 xo_emit("{D:@}{e:type/link}"); 484 return (1); 485 case S_IFSOCK: 486 xo_emit("{D:=}{e:type/socket}"); 487 return (1); 488 case S_IFWHT: | 196 } else { 197 xo_emit("{t:mode/%s}{e:mode_octal/%03o} {t:links/%*u} {t:user/%-*s} {t:group/%-*s} ", 198 buf, (int) sp->st_mode & ALLPERMS, dp->s_nlink, sp->st_nlink, 199 dp->s_user, np->user, dp->s_group, np->group); 200 } 201 if (S_ISBLK(sp->st_mode)) 202 asprintf(&type, "block"); 203 if (S_ISCHR(sp->st_mode)) --- 277 unchanged lines hidden (view full) --- 481 return (1); 482 case S_IFLNK: 483 xo_emit("{D:@}{e:type/link}"); 484 return (1); 485 case S_IFSOCK: 486 xo_emit("{D:=}{e:type/socket}"); 487 return (1); 488 case S_IFWHT: |
489 xo_emit("{D:%}{e:type/whiteout}"); | 489 xo_emit("{D:%%}{e:type/whiteout}"); |
490 return (1); 491 default: 492 break; 493 } 494 if (mode & (S_IXUSR | S_IXGRP | S_IXOTH)) { 495 xo_emit("{D:*}{e:executable/}"); 496 return (1); 497 } --- 264 unchanged lines hidden --- | 490 return (1); 491 default: 492 break; 493 } 494 if (mode & (S_IXUSR | S_IXGRP | S_IXOTH)) { 495 xo_emit("{D:*}{e:executable/}"); 496 return (1); 497 } --- 264 unchanged lines hidden --- |