nfsctl: fix building with newer arches
authorMike Frysinger <vapier@gentoo.org>
Thu, 5 Jan 2012 18:21:24 +0000 (13:21 -0500)
committerSteve Dickson <steved@redhat.com>
Thu, 5 Jan 2012 20:42:40 +0000 (15:42 -0500)
Newer arches omitting both nfsctl and nfsservctl which breaks nfsctl.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/nfs/nfsctl.c

index 89fa1a4..fec775f 100644 (file)
 #endif
 
 #include <unistd.h>
 #endif
 
 #include <unistd.h>
+#include <errno.h>
 #include <asm/unistd.h>
 #include "nfslib.h"
 
 /* compatibility hack... */
 #include <asm/unistd.h>
 #include "nfslib.h"
 
 /* compatibility hack... */
-#ifndef __NR_nfsctl
+#if !defined(__NR_nfsctl) && defined(__NR_nfsservctl)
 #define __NR_nfsctl    __NR_nfsservctl
 #endif
 
 int
 nfsctl (int cmd, struct nfsctl_arg * argp, union nfsctl_res * resp)
 {
 #define __NR_nfsctl    __NR_nfsservctl
 #endif
 
 int
 nfsctl (int cmd, struct nfsctl_arg * argp, union nfsctl_res * resp)
 {
+#ifdef __NR_nfsctl
   return syscall (__NR_nfsctl, cmd, argp, resp);
   return syscall (__NR_nfsctl, cmd, argp, resp);
+#else
+  errno = ENOSYS;
+  return -1;
+#endif
 }
 }