about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-04-15 19:29:31 +0000
committerEric Wong <normalperson@yhbt.net>2013-05-11 11:28:42 +0000
commit27c299a123597729d011b4ec205acb0e0bc48b83 (patch)
tree36190c63a30c77499fbe06063ef1530455ec8f44
parentcce7f3c33207c534f9e5a6c0cb389a97df21235b (diff)
downloadcmogstored-27c299a123597729d011b4ec205acb0e0bc48b83.tar.gz
We must set errno manually for die_errno() if posix_memalign fails
(cherry picked from commit 8c79cf794f6178b6978743af99d498ca0b449fb1)
-rw-r--r--alloc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/alloc.c b/alloc.c
index 04bc789..5afcee2 100644
--- a/alloc.c
+++ b/alloc.c
@@ -73,6 +73,8 @@ void *mog_cachealign(size_t size)
         case 0: return ptr;
         case ENOMEM: mog_oom();
         }
+
+        errno = err; /* most likely EINVAL */
         die_errno("posix_memalign failed");
 }