summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:53:58 +0900
committerMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:53:58 +0900
commit208fe39375bf7ab3d7ab1b8fcb7f603855f57def (patch)
tree0f11ec88c17127db27b26acf77bb22ae6e26bcc8
parentcebb51f8567f63fdb42d20bd5c3b052cd56c6aaa (diff)
Fix FD/handle conversion bug
On systems where int size != pointer size the coversion resulted in compile-time error. Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
-rw-r--r--src/fd.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fd.hpp b/src/fd.hpp
index c736665..9a98f5b 100644
--- a/src/fd.hpp
+++ b/src/fd.hpp
@@ -60,7 +60,7 @@ namespace xs
enum {retired_fd = -1};
inline void *fdtoptr (fd_t fd_)
{
- return (void*) (fd_ + 1);
+ return (void*) (((char*) 0) + fd_ + 1);
}
inline fd_t ptrtofd (void *ptr_)
{