[almanah] vfs: Set errno when returning -1 to gpgme
- From: Philip Withnall <pwithnall src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [almanah] vfs: Set errno when returning -1 to gpgme
 
- Date: Tue,  6 Dec 2016 07:55:37 +0000 (UTC)
 
commit 761e029142241f394313c8ed238f32d122926a34
Author: Philip Withnall <philip tecnocode co uk>
Date:   Tue Dec 6 00:57:07 2016 +0000
    vfs: Set errno when returning -1 to gpgme
    
    gpgme expects that errno is set appropriately if any of its callback
    functions return an error.
 src/vfs.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/vfs.c b/src/vfs.c
index be06b5f..cbcbca1 100644
--- a/src/vfs.c
+++ b/src/vfs.c
@@ -181,8 +181,10 @@ _gpgme_write_cb (void *handle, const void *buffer, size_t size)
                        new_buffer = gcr_secure_memory_realloc (npm_closure->buffer, new_size);
                }
 
-               if (!new_buffer)
+               if (!new_buffer) {
+                       errno = ENOMEM;
                        return -1;
+               }
 
                npm_closure->buffer = new_buffer;
                npm_closure->buffer_size = new_size;
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]