Patchwork fwts-collect: tidy up error handling

login
register
mail settings
Submitter Colin King
Date Feb. 10, 2012, 3:44 p.m.
Message ID <1328888654-29460-1-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/140673/
State Accepted
Headers show

Comments

Colin King - Feb. 10, 2012, 3:44 p.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 scripts/fwts-collect |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Keng-Yu Lin - Feb. 21, 2012, 3:23 a.m.
On Fri, Feb 10, 2012 at 11:44 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  scripts/fwts-collect |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/fwts-collect b/scripts/fwts-collect
> index f8bd12c..37e0042 100755
> --- a/scripts/fwts-collect
> +++ b/scripts/fwts-collect
> @@ -116,8 +116,8 @@ trap 'on_die' TERM INT
>  mkdir $TMPDIR
>
>  err=$?
> -if [ $? -ne 0 ]; then
> -       echo "Cannot create temporary directory $TMPDIR: error $?" 1>&2
> +if [ $err -ne 0 ]; then
> +       echo "Cannot create temporary directory $TMPDIR: error $err" 1>&2
>        exit 1
>  fi
>
> --
> 1.7.9
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Chris Van Hoof - March 1, 2012, 8:33 p.m.
On 02/20/2012 10:23 PM, Keng-Yü Lin wrote:
> On Fri, Feb 10, 2012 at 11:44 PM, Colin King<colin.king@canonical.com>  wrote:
>> From: Colin Ian King<colin.king@canonical.com>
>>
>> Signed-off-by: Colin Ian King<colin.king@canonical.com>
>> ---
>>   scripts/fwts-collect |    4 ++--
>>   1 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/scripts/fwts-collect b/scripts/fwts-collect
>> index f8bd12c..37e0042 100755
>> --- a/scripts/fwts-collect
>> +++ b/scripts/fwts-collect
>> @@ -116,8 +116,8 @@ trap 'on_die' TERM INT
>>   mkdir $TMPDIR
>>
>>   err=$?
>> -if [ $? -ne 0 ]; then
>> -       echo "Cannot create temporary directory $TMPDIR: error $?" 1>&2
>> +if [ $err -ne 0 ]; then
>> +       echo "Cannot create temporary directory $TMPDIR: error $err" 1>&2
>>         exit 1
>>   fi
>>
>> --
>> 1.7.9
>>
> Acked-by: Keng-Yu Lin<kengyu@canonical.com>

This was used in the fwts-live images last week at Plugfest and 
fwts-collect works as expected:

Acked-by: Chris Van Hoof <vanhoof@canonical.com>

Patch

diff --git a/scripts/fwts-collect b/scripts/fwts-collect
index f8bd12c..37e0042 100755
--- a/scripts/fwts-collect
+++ b/scripts/fwts-collect
@@ -116,8 +116,8 @@  trap 'on_die' TERM INT
 mkdir $TMPDIR
 
 err=$?
-if [ $? -ne 0 ]; then
-	echo "Cannot create temporary directory $TMPDIR: error $?" 1>&2
+if [ $err -ne 0 ]; then
+	echo "Cannot create temporary directory $TMPDIR: error $err" 1>&2
 	exit 1
 fi