Deleted Added
full compact
fsdb.c (163846) fsdb.c (207141)
1/* $NetBSD: fsdb.c,v 1.2 1995/10/08 23:18:10 thorpej Exp $ */
2
3/*
4 * Copyright (c) 1995 John T. Kohl
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 16 unchanged lines hidden (view full) ---

25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef lint
32static const char rcsid[] =
1/* $NetBSD: fsdb.c,v 1.2 1995/10/08 23:18:10 thorpej Exp $ */
2
3/*
4 * Copyright (c) 1995 John T. Kohl
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 16 unchanged lines hidden (view full) ---

25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef lint
32static const char rcsid[] =
33 "$FreeBSD: head/sbin/fsdb/fsdb.c 163846 2006-10-31 22:07:29Z pjd $";
33 "$FreeBSD: head/sbin/fsdb/fsdb.c 207141 2010-04-24 07:05:35Z jeff $";
34#endif /* not lint */
35
36#include <sys/param.h>
37#include <sys/time.h>
38#include <ctype.h>
39#include <err.h>
40#include <grp.h>
41#include <histedit.h>

--- 349 unchanged lines hidden (view full) ---

391 "regular",
392 "unregistered #9",
393 "symlink",
394 "unregistered #11",
395 "socket",
396 "unregistered #13",
397 "whiteout",
398};
34#endif /* not lint */
35
36#include <sys/param.h>
37#include <sys/time.h>
38#include <ctype.h>
39#include <err.h>
40#include <grp.h>
41#include <histedit.h>

--- 349 unchanged lines hidden (view full) ---

391 "regular",
392 "unregistered #9",
393 "symlink",
394 "unregistered #11",
395 "socket",
396 "unregistered #13",
397 "whiteout",
398};
399
399
400int diroff;
400int slot;
401
402int
403scannames(struct inodesc *idesc)
404{
405 struct direct *dirp = idesc->id_dirp;
406
401int slot;
402
403int
404scannames(struct inodesc *idesc)
405{
406 struct direct *dirp = idesc->id_dirp;
407
407 printf("slot %d ino %d reclen %d: %s, `%.*s'\n",
408 slot++, dirp->d_ino, dirp->d_reclen, typename[dirp->d_type],
409 dirp->d_namlen, dirp->d_name);
408 printf("slot %d off %d ino %d reclen %d: %s, `%.*s'\n",
409 slot++, diroff, dirp->d_ino, dirp->d_reclen,
410 typename[dirp->d_type], dirp->d_namlen, dirp->d_name);
411 diroff += dirp->d_reclen;
410 return (KEEPON);
411}
412
413CMDFUNCSTART(ls)
414{
415 struct inodesc idesc;
416 checkactivedir(); /* let it go on anyway */
417
418 slot = 0;
412 return (KEEPON);
413}
414
415CMDFUNCSTART(ls)
416{
417 struct inodesc idesc;
418 checkactivedir(); /* let it go on anyway */
419
420 slot = 0;
421 diroff = 0;
419 idesc.id_number = curinum;
420 idesc.id_func = scannames;
421 idesc.id_type = DATA;
422 idesc.id_fix = IGNORE;
423 ckinode(curinode, &idesc);
424 curinode = ginode(curinum);
425
426 return 0;

--- 776 unchanged lines hidden ---
422 idesc.id_number = curinum;
423 idesc.id_func = scannames;
424 idesc.id_type = DATA;
425 idesc.id_fix = IGNORE;
426 ckinode(curinode, &idesc);
427 curinode = ginode(curinum);
428
429 return 0;

--- 776 unchanged lines hidden ---