7e8cb518e9
into a header. This version instantiates the given argument only once. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24900 a95241bf-73f2-0310-859d-f6bbb57e9c96
19 lines
421 B
C
19 lines
421 B
C
/*
|
|
* Copyright 2008, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _SYSCALL_UTILS_H
|
|
#define _SYSCALL_UTILS_H
|
|
|
|
#define RETURN_AND_SET_ERRNO(err) \
|
|
do { \
|
|
__typeof(err) raseResult = (err); \
|
|
if (raseResult < 0) { \
|
|
errno = raseResult; \
|
|
return -1; \
|
|
} \
|
|
return raseResult; \
|
|
} while (false)
|
|
|
|
#endif // _SYSCALL_UTILS_H
|