PolicyKit: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Wed Nov 21 17:11:39 PST 2007


 src/kit/kit-memory.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 67befeae30075d1c7d068e4bb911b796ecfa4626
Author: David Zeuthen <davidz at redhat.com>
Date:   Wed Nov 21 20:11:04 2007 -0500

    set errno to ENOMEM when forcibly failing an allocation

diff --git a/src/kit/kit-memory.c b/src/kit/kit-memory.c
index e1a79d9..4b3ea9c 100644
--- a/src/kit/kit-memory.c
+++ b/src/kit/kit-memory.c
@@ -32,6 +32,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <errno.h>
 
 #include <kit/kit-memory.h>
 #include <kit/kit-test.h>
@@ -90,6 +91,7 @@ kit_malloc (size_t bytes)
         void *p;
 
         if (_fail_nth != -1 && _total_allocs == _fail_nth) {
+                errno = ENOMEM;
                 return NULL;
         }
 
@@ -117,6 +119,7 @@ kit_malloc0 (size_t bytes)
         void *p;
 
         if (_fail_nth != -1 && _total_allocs == _fail_nth) {
+                errno = ENOMEM;
                 return NULL;
         }
 
@@ -153,6 +156,7 @@ kit_realloc (void *memory, size_t bytes)
         }
 
         if (_fail_nth != -1 && _total_allocs == _fail_nth) {
+                errno = ENOMEM;
                 return NULL;
         }
 


More information about the hal-commit mailing list