~sircmpwn/ctools

216800a3be17262645afd196a72ba2feedc3bc9e — Drew DeVault 2 years ago bf7328d
nice: no-op on non-XSI systems

The C library function is an XSI extension but apparently they command
is not!
2 files changed, 6 insertions(+), 2 deletions(-)

M meson.build
M src/nice.c
M meson.build => meson.build +2 -2
@@ 18,14 18,14 @@ oneshots = [
	'chown',
	'cksum',
	'cmp',
	'true',
	'false',
	'nice',
	'true',
	'uname',
	'unlink',
]

xsi_oneshots = [
	'nice',
]

cc = meson.get_compiler('c')

M src/nice.c => src/nice.c +4 -0
@@ 40,9 40,13 @@ main(int argc, char *argv[])
		return 1;
	}

#ifdef _XOPEN_SOURCE
	if (nice(increment) == -1) {
		perror("nice");
	}
#else
	fprintf(stderr, "nice: compiled without XSI support; no-op\n");
#endif

	if (execvp(argv[optind], argv + optind) == -1) {
		perror("execvp");