summaryrefslogtreecommitdiffstats
path: root/pwgr.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2006-05-29 04:09:21 +0000
committerNeil Brown <neilb@suse.de>2006-05-29 04:09:21 +0000
commitc97be4db86a710faef7b21829c2aa59f228212b2 (patch)
tree40c4a3e12bd79e8299ef557bcf7589f2b6b757ce /pwgr.c
parent0c239ef733aa16d9716942de204b73d5f80fe557 (diff)
downloadmdadm-c97be4db86a710faef7b21829c2aa59f228212b2.tar.gz
mdadm-c97be4db86a710faef7b21829c2aa59f228212b2.tar.xz
mdadm-c97be4db86a710faef7b21829c2aa59f228212b2.zip
Improve compiling for static binaries.
Have "#ifdef STATIC" in config.c, and the 'rmconf' target was a mess. Instead, create 'pwgr.c' with stub routines for those unavailable when statically compiled, and include that in STATICOBJ Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'pwgr.c')
-rw-r--r--pwgr.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/pwgr.c b/pwgr.c
new file mode 100644
index 0000000..a07de33
--- /dev/null
+++ b/pwgr.c
@@ -0,0 +1,17 @@
+
+/*
+ * We cannot link a static binary with passwd/group support, so
+ * just do without
+ */
+#include <stdlib.h>
+#include <pwd.h>
+#include <grp.h>
+
+struct passwd *getpwnam(const char *name)
+{
+ return NULL;
+}
+struct group *getgrnam(const char *name)
+{
+ return NULL;
+}