[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [BusyBox] [patch] added -x switch to du.c
From:       Edward Betts <edward () debian ! org>
Date:       2002-03-27 9:57:03
[Download RAW message or body]

Is my patch any good? How do I get it into CVS?

Edward Betts <edward@debian.org> wrote:
> --- fileutils/du.c.was	Thu Mar 21 01:26:38 2002
> +++ fileutils/du.c	Thu Mar 21 01:32:35 2002
> @@ -4,6 +4,7 @@
>   *
>   * 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
> @@ -40,6 +41,8 @@
>  
>  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;
>  
> @@ -69,6 +72,10 @@
>  		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);
> @@ -133,7 +140,7 @@
>  	print = print_normal;
>  
>  	/* parse argv[] */
> -	while ((c = getopt(argc, argv, "sl"
> +	while ((c = getopt(argc, argv, "slx"
>  #ifdef CONFIG_FEATURE_HUMAN_READABLE
>  "hm"
>  #endif
> @@ -144,6 +151,9 @@
>  					break;
>  			case 'l':
>  					count_hardlinks = 1;
> +					break;
> +			case 'x':
> +					one_file_system = 1;
>  					break;
>  #ifdef CONFIG_FEATURE_HUMAN_READABLE
>  			case 'h': disp_hr = 0;        break;
> 
> -- 
> The enemy's gate is down
> http://people.debian.org/~edward/
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://codepoet.org/mailman/listinfo/busybox

-- 
The enemy's gate is down
http://people.debian.org/~edward/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic