diff mbox series

[06/21] io: Fix Error usage in a comment <example>

Message ID 20191130194240.10517-7-armbru@redhat.com
State New
Headers show
Series Error handling fixes, may contain 4.2 material | expand

Commit Message

Markus Armbruster Nov. 30, 2019, 7:42 p.m. UTC
Cc: "Daniel P. Berrangé" <berrange@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 include/io/task.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Vladimir Sementsov-Ogievskiy Dec. 5, 2019, 3:30 p.m. UTC | #1
30.11.2019 22:42, Markus Armbruster wrote:
> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
>   include/io/task.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/io/task.h b/include/io/task.h
> index 5cb9faf9f2..1abbfb8b65 100644
> --- a/include/io/task.h
> +++ b/include/io/task.h
> @@ -119,7 +119,7 @@ typedef void (*QIOTaskWorker)(QIOTask *task,
>    *   gboolean myobject_operation_timer(gpointer opaque)
>    *   {
>    *      QIOTask *task = QIO_TASK(opaque);
> - *      Error *err;*
> + *      Error *err = NULL;
>    *
>    *      ...check something important...
>    *       if (err) {
> 

Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>

(I also think you can safely s/Fix Error usage/Fix typo/ in subject)
Markus Armbruster Dec. 6, 2019, 7:20 a.m. UTC | #2
Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> writes:

> 30.11.2019 22:42, Markus Armbruster wrote:
>> Cc: "Daniel P. Berrangé" <berrange@redhat.com>
>> Signed-off-by: Markus Armbruster <armbru@redhat.com>
>> ---
>>   include/io/task.h | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/include/io/task.h b/include/io/task.h
>> index 5cb9faf9f2..1abbfb8b65 100644
>> --- a/include/io/task.h
>> +++ b/include/io/task.h
>> @@ -119,7 +119,7 @@ typedef void (*QIOTaskWorker)(QIOTask *task,
>>    *   gboolean myobject_operation_timer(gpointer opaque)
>>    *   {
>>    *      QIOTask *task = QIO_TASK(opaque);
>> - *      Error *err;*
>> + *      Error *err = NULL;
>>    *
>>    *      ...check something important...
>>    *       if (err) {
>> 
>
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>
> (I also think you can safely s/Fix Error usage/Fix typo/ in subject)

I'd say it's both: the trailing * is clearly a typo, but the missing
initializer is asking Murphy for random crashes at inopportune times.
Examples better set *good* examples :)

Thanks!
diff mbox series

Patch

diff --git a/include/io/task.h b/include/io/task.h
index 5cb9faf9f2..1abbfb8b65 100644
--- a/include/io/task.h
+++ b/include/io/task.h
@@ -119,7 +119,7 @@  typedef void (*QIOTaskWorker)(QIOTask *task,
  *   gboolean myobject_operation_timer(gpointer opaque)
  *   {
  *      QIOTask *task = QIO_TASK(opaque);
- *      Error *err;*
+ *      Error *err = NULL;
  *
  *      ...check something important...
  *       if (err) {