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-04-16 01:37:14 +0000
commit8c79cf794f6178b6978743af99d498ca0b449fb1 (patch)
treed7a04049f80c35198fe1c09a69c45ab619695d05
parent9427f2989eae96106090d77ddff1656f8510957d (diff)
downloadcmogstored-8c79cf794f6178b6978743af99d498ca0b449fb1.tar.gz
We must set errno manually for die_errno() if posix_memalign fails
-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");
 }