From 34344de9795c7f492ad5128ed0c9b400172db0f4 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Tue, 17 Apr 2012 21:41:26 +0200 Subject: [PATCH] build-sys: uClibc does not have rpmatch() Add simple replacement with hardcoded y/n responses to allow compilation on systems without rpmatch(). Signed-off-by: Sami Kerola --- include/Makefile.am | 1 + include/rpmatch.h | 9 +++++++++ skill.c | 1 + 3 files changed, 11 insertions(+) create mode 100644 include/rpmatch.h diff --git a/include/Makefile.am b/include/Makefile.am index 9c2a03c5..fb4e5a53 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,5 +1,6 @@ dist_noinst_HEADERS = \ c.h \ nls.h \ + rpmatch.h \ strutils.h \ xalloc.h diff --git a/include/rpmatch.h b/include/rpmatch.h new file mode 100644 index 00000000..2541aa3d --- /dev/null +++ b/include/rpmatch.h @@ -0,0 +1,9 @@ +#ifndef PROCPS_NG_RPMATCH_H +#define PROCPS_NG_RPMATCH_H + +#ifndef HAVE_RPMATCH +#define rpmatch(r) \ + (*r == 'y' || *r == 'Y' ? 1 : *r == 'n' || *r == 'N' ? 0 : -1) +#endif + +#endif /* PROCPS_NG_RPMATCH_H */ diff --git a/skill.c b/skill.c index 6c2d582d..791cfa05 100644 --- a/skill.c +++ b/skill.c @@ -44,6 +44,7 @@ #include "proc/devname.h" #include "proc/procps.h" /* char *user_from_uid(uid_t uid) */ #include "proc/version.h" /* procps_version */ +#include "rpmatch.h" #define DEFAULT_NICE 4