From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Hrubis Date: Mon, 22 Feb 2016 14:35:14 +0100 Subject: [LTP] [PATCH 1/5] open_posix: add SAFE_PFUNC macro In-Reply-To: References: Message-ID: <20160222133513.GB6434@rei> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ltp@lists.linux.it 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 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