*
* Copyright (C) 1999,2000,2001 by Lineo, inc. and John Beppu
* Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
+ * Copyright (C) 2002 Edward Betts <edward@debian.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
static int du_depth = 0;
static int count_hardlinks = 0;
+static int one_file_system = 0;
+static dev_t dir_dev = 0;
static Display *print;
perror_msg("%s", filename);
return 0;
}
+ if (du_depth == 0)
+ dir_dev = statbuf.st_dev;
+ else if (one_file_system && dir_dev != statbuf.st_dev)
+ return 0;
du_depth++;
sum = (statbuf.st_blocks >> 1);
print = print_normal;
/* parse argv[] */
- while ((c = getopt(argc, argv, "sl"
+ while ((c = getopt(argc, argv, "slx"
#ifdef CONFIG_FEATURE_HUMAN_READABLE
"hm"
#endif
case 'l':
count_hardlinks = 1;
break;
+ case 'x':
+ one_file_system = 1;
+ break;
#ifdef CONFIG_FEATURE_HUMAN_READABLE
case 'h': disp_hr = 0; break;
case 'm': disp_hr = MEGABYTE; break;
return status;
}
-/* $Id: du.c,v 1.52 2001/12/17 15:26:25 kraai Exp $ */
+/* $Id: du.c,v 1.53 2002/04/06 23:16:44 andersen Exp $ */
/*
Local Variables:
c-file-style: "linux"
"$ dpkg-deb -X ./busybox_0.48-1_i386.deb /tmp\n"
#define du_trivial_usage \
- "[-ls" USAGE_HUMAN_READABLE("hm") USAGE_NOT_HUMAN_READABLE("") "k] [FILE]..."
+ "[-lsx" USAGE_HUMAN_READABLE("hm") USAGE_NOT_HUMAN_READABLE("") "k] [FILE]..."
#define du_full_usage \
"Summarizes disk space used for each FILE and/or directory.\n" \
"Disk space is printed in units of 1024 bytes.\n\n" \
USAGE_HUMAN_READABLE( \
"\n\t-h\tprint sizes in human readable format (e.g., 1K 243M 2G )\n" \
"\t-m\tprint sizes in megabytes\n" \
+ "\t-x\tskip directories on different filesystems\n" \
"\t-k\tprint sizes in kilobytes(default)") USAGE_NOT_HUMAN_READABLE( \
"\n\t-k\tprint sizes in kilobytes(compatibility)")
#define du_example_usage \