Patchwork [U-Boot] tools/mkenvimage.c: Fix a merge issue

login
register
mail settings
Submitter Horst Kronstorfer
Date Dec. 24, 2011, 10:41 a.m.
Message ID <1324723318-32752-1-git-send-email-hkronsto@frequentis.com>
Download mbox | patch
Permalink /patch/133157/
State Accepted
Commit 72ebafbe2bd5044eecbfdaa132390a1421db25be
Headers show

Comments

Horst Kronstorfer - Dec. 24, 2011, 10:41 a.m.
With bfcc40bb09b05c90cc3b1496abb270eb8aa72134 'optopt' was reverted.

Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
---
 tools/mkenvimage.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Wolfgang Denk - Dec. 24, 2011, 2:57 p.m.
Dear Horst Kronstorfer,

In message <1324723318-32752-1-git-send-email-hkronsto@frequentis.com> you wrote:
> With bfcc40bb09b05c90cc3b1496abb270eb8aa72134 'optopt' was reverted.
> 
> Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
> ---
>  tools/mkenvimage.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
> index c5ed373..8ee2bd0 100644
> --- a/tools/mkenvimage.c
> +++ b/tools/mkenvimage.c
> @@ -122,11 +122,11 @@ int main(int argc, char **argv)
>  			return EXIT_SUCCESS;
>  		case ':':
>  			fprintf(stderr, "Missing argument for option -%c\n",
> -				option);
> +				optopt);
>  			usage(argv[0]);
>  			return EXIT_FAILURE;
>  		default:
> -			fprintf(stderr, "Wrong option -%c\n", option);
> +			fprintf(stderr, "Wrong option -%c\n", optopt);
>  			usage(prg);
>  			return EXIT_FAILURE;

This change is definitely wrong, as "optopt" is nowhere declared nor
used in tools/mkenvimage.c


Best regards,

Wolfgang Denk
Horst Kronstorfer - Dec. 24, 2011, 6:41 p.m.
On 12/24/2011 03:57 PM, Wolfgang Denk wrote:
> Dear Horst Kronstorfer,
>
> In message<1324723318-32752-1-git-send-email-hkronsto@frequentis.com>  you wrote:
>> With bfcc40bb09b05c90cc3b1496abb270eb8aa72134 'optopt' was reverted.
>>
>> Signed-off-by: Horst Kronstorfer<hkronsto@frequentis.com>
>> ---
>>   tools/mkenvimage.c |    4 ++--
>>   1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
>> index c5ed373..8ee2bd0 100644
>> --- a/tools/mkenvimage.c
>> +++ b/tools/mkenvimage.c
>> @@ -122,11 +122,11 @@ int main(int argc, char **argv)
>>   			return EXIT_SUCCESS;
>>   		case ':':
>>   			fprintf(stderr, "Missing argument for option -%c\n",
>> -				option);
>> +				optopt);
>>   			usage(argv[0]);
>>   			return EXIT_FAILURE;
>>   		default:
>> -			fprintf(stderr, "Wrong option -%c\n", option);
>> +			fprintf(stderr, "Wrong option -%c\n", optopt);
>>   			usage(prg);
>>   			return EXIT_FAILURE;
>
> This change is definitely wrong, as "optopt" is nowhere declared nor
> used in tools/mkenvimage.c
>

'optopt' is declared in unistd.h ... see 'man 3 getopt.'

br
-h

>
> Best regards,
>
> Wolfgang Denk
>
Wolfgang Denk - Jan. 5, 2012, 3:36 p.m.
Dear Horst Kronstorfer,

In message <1324723318-32752-1-git-send-email-hkronsto@frequentis.com> you wrote:
> With bfcc40bb09b05c90cc3b1496abb270eb8aa72134 'optopt' was reverted.
> 
> Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
> ---
>  tools/mkenvimage.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c
index c5ed373..8ee2bd0 100644
--- a/tools/mkenvimage.c
+++ b/tools/mkenvimage.c
@@ -122,11 +122,11 @@  int main(int argc, char **argv)
 			return EXIT_SUCCESS;
 		case ':':
 			fprintf(stderr, "Missing argument for option -%c\n",
-				option);
+				optopt);
 			usage(argv[0]);
 			return EXIT_FAILURE;
 		default:
-			fprintf(stderr, "Wrong option -%c\n", option);
+			fprintf(stderr, "Wrong option -%c\n", optopt);
 			usage(prg);
 			return EXIT_FAILURE;
 		}