[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH] tools/libxl: Fix the errno



On 03/20/2015 04:25 PM, Ross Lagerwall wrote:
> On 03/20/2015 08:17 AM, Wen Congyang wrote:
>> After commit 6d896e13, we should pass -errno on read failure.
>>
>> Signed-off-by: Wen Congyang <wency@xxxxxxxxxxxxxx>
>> ---
>>   tools/libxl/libxl_aoutils.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
>> index 0d4c8af..b93f0e4 100644
>> --- a/tools/libxl/libxl_aoutils.c
>> +++ b/tools/libxl/libxl_aoutils.c
>> @@ -262,7 +262,7 @@ static void datacopier_readable(libxl__egc *egc, 
>> libxl__ev_fd *ev,
>>                   assert(ferror(dc->log));
>>                   assert(errno);
>>                   LOGE(ERROR, "error logging %s", dc->copywhat);
>> -                datacopier_callback(egc, dc, 0, errno);
>> +                datacopier_callback(egc, dc, 0, -errno);
>>                   return;
>>               }
>>           }
>>
> 
> Acked-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
> 

I forgot another place, it should be:

diff --git a/tools/libxl/libxl_aoutils.c b/tools/libxl/libxl_aoutils.c
index 0d4c8af..965afc3 100644
--- a/tools/libxl/libxl_aoutils.c
+++ b/tools/libxl/libxl_aoutils.c
@@ -249,7 +249,7 @@ static void datacopier_readable(libxl__egc *egc, 
libxl__ev_fd *ev,
             if (errno == EWOULDBLOCK) break;
             LOGE(ERROR, "error reading %s during copy of %s",
                  dc->readwhat, dc->copywhat);
-            datacopier_callback(egc, dc, 0, errno);
+            datacopier_callback(egc, dc, 0, -errno);
             return;
         }
         if (r == 0) {
@@ -262,7 +262,7 @@ static void datacopier_readable(libxl__egc *egc, 
libxl__ev_fd *ev,
                 assert(ferror(dc->log));
                 assert(errno);
                 LOGE(ERROR, "error logging %s", dc->copywhat);
-                datacopier_callback(egc, dc, 0, errno);
+                datacopier_callback(egc, dc, 0, -errno);
                 return;
             }
         }


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.