Patchwork [10/25] freefrag: fix up getopt case statement

login
register
mail settings
Submitter Eric Sandeen
Date Sept. 16, 2011, 8:49 p.m.
Message ID <1316206180-6375-11-git-send-email-sandeen@redhat.com>
Download mbox | patch
Permalink /patch/115055/
State Accepted
Headers show

Comments

Eric Sandeen - Sept. 16, 2011, 8:49 p.m.
There is no need to print out a "bad option" message; getopt
does that for us, and in fact will change "c" to "?" so
it's not even useful.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
 misc/e2freefrag.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)
Theodore Ts'o - Sept. 16, 2011, 10:54 p.m.
On Fri, Sep 16, 2011 at 03:49:25PM -0500, Eric Sandeen wrote:
> There is no need to print out a "bad option" message; getopt
> does that for us, and in fact will change "c" to "?" so
> it's not even useful.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Applied, thanks.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/misc/e2freefrag.c b/misc/e2freefrag.c
index e6fd67e..419c6fc 100644
--- a/misc/e2freefrag.c
+++ b/misc/e2freefrag.c
@@ -282,10 +282,8 @@  int main(int argc, char *argv[])
 			}
 			chunk_info.chunkbytes *= 1024;
 			break;
-		default:
-			fprintf(stderr, "%s: bad option '%c'\n",
-				progname, c);
 		case 'h':
+		default:
 			usage(progname);
 			break;
 		}