]> granicus.if.org Git - procps-ng/commitdiff
build-sys: uClibc does not have rpmatch()
authorSami Kerola <kerolasa@iki.fi>
Tue, 17 Apr 2012 19:41:26 +0000 (21:41 +0200)
committerSami Kerola <kerolasa@iki.fi>
Wed, 18 Apr 2012 08:03:55 +0000 (10:03 +0200)
Add simple replacement with hardcoded y/n responses to allow
compilation on systems without rpmatch().

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
include/Makefile.am
include/rpmatch.h [new file with mode: 0644]
skill.c

index 9c2a03c5f27affcbb4633684d3a5c32ffbe29934..fb4e5a534cba79abc924b62a05bb33cb6a537690 100644 (file)
@@ -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 (file)
index 0000000..2541aa3
--- /dev/null
@@ -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 6c2d582d0b915c93912985f91286dd809248e8bf..791cfa05fd990fa1eeb79a40c9229c378cfbfbd9 100644 (file)
--- 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