[LTP] [PATCH 1/5] open_posix: add SAFE_PFUNC macro
Cyril Hrubis
chrubis@suse.cz
Mon Feb 22 14:35:14 CET 2016
Hi!
> +#ifndef __SAFE_MACROS_H__
> +#define __SAFE_MACROS_H__
The file lacks GNU header and the guards should be SAFE_HELPERS rather
than SAFE_MACROS.
> +#include <string.h>
Technically we should incude stdio.h for fflush() and printf() as well.
> +#define SAFE_PFUNC(op) \
> +do {\
> + int ret = (op); \
> + if (ret != 0) { \
> + printf("Test %s unresolved: got %i (%s) on line %i\n %s\n", \
> + __FILE__, ret, strerror(ret), __LINE__, #op); \
> + fflush(stdout); \
> + exit(PTS_UNRESOLVED); \
> + } \
> +} while (0)
> +
> +#endif
Otherwise it looks good.
--
Cyril Hrubis
chrubis@suse.cz
More information about the Ltp
mailing list