From: Sascha Wildner Date: Sat, 10 Dec 2011 14:47:00 +0000 (+0100) Subject: vquota(8): Silence 'has more than one link' messages. X-Git-Tag: v3.0.0~421^2~15 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/447003570d8f7371a7f81b676e27a00aa3f33cc9 vquota(8): Silence 'has more than one link' messages. Also, print the usage if an unknown command is given. In the manual page, note that the output size is in bytes. --- diff --git a/sbin/vquota/vquota.8 b/sbin/vquota/vquota.8 index a9678926a4..581bf9a3da 100644 --- a/sbin/vquota/vquota.8 +++ b/sbin/vquota/vquota.8 @@ -46,9 +46,9 @@ The commands are as follows: .Bl -tag -width indent .\" ==== check ==== .It Cm check Ar directory -Reports the space occupied by files names located in the +Reports the space (in bytes) occupied by files names located in the directory hierarchy present under -.Ar directory +.Ar directory . .El . .Sh HISTORY diff --git a/sbin/vquota/vquota.c b/sbin/vquota/vquota.c index c412ca369e..564973e1c4 100644 --- a/sbin/vquota/vquota.c +++ b/sbin/vquota/vquota.c @@ -80,12 +80,13 @@ get_dirsize(char* dirname) retval = 1; break; default: +#if 0 /* files with more than one link, undecided */ // if (p->fts_statp->st_nlink > 1 && linkchk(p)) if (p->fts_statp->st_nlink > 1) fprintf(stderr, "%s has more than one link\n", p->fts_name ); - +#endif size_of_files += p->fts_statp->st_size; } } @@ -103,6 +104,8 @@ main(int argc, char **argv) if (strcmp(argv[1], "check") == 0) { return get_dirsize(argv[2]); + } else { + usage(1); } return 0;