]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/nfsquota.c
netatalk: fix a crash on Solaris when registering with mDNS
[netatalk.git] / etc / afpd / nfsquota.c
index d7c1125959fa006409da99073a6d4a6f221f608a..50440ab42b6d2f38677dad27c86a88ae8299b218 100644 (file)
@@ -1,5 +1,4 @@
 /*
- * $Id: nfsquota.c,v 1.12 2005-04-28 20:49:44 bfernhomberg Exp $
  *
  * parts of this are lifted from the bsd quota program and are
  * therefore under the following copyright:
 #include "config.h"
 #endif /* HAVE_CONFIG_H */
 
-#ifndef NO_QUOTA_SUPPORT
+#if !defined(NO_QUOTA_SUPPORT) && !defined(HAVE_LIBQUOTA)
 #include <stdio.h>
-/* STDC check */
-#if STDC_HEADERS
 #include <string.h>
-#else /* STDC_HEADERS */
-#ifndef HAVE_STRCHR
-#define strchr index
-#define strrchr index
-#endif /* HAVE_STRCHR */
-char *strchr (), *strrchr ();
-#ifndef HAVE_MEMCPY
-#define memcpy(d,s,n) bcopy ((s), (d), (n))
-#define memmove(d,s,n) bcopy ((s), (d), (n))
-#endif /* ! HAVE_MEMCPY */
-#endif /* STDC_HEADERS */
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <sys/param.h> /* for DEV_BSIZE */
@@ -57,11 +43,10 @@ char *strchr (), *strrchr ();
 
 /* lifted (with modifications) from the bsd quota program */
 static int
-callaurpc(vol, prognum, versnum, procnum, inproc, in, outproc, out)
-struct vol *vol;
-u_long prognum, versnum, procnum;
-xdrproc_t inproc, outproc;
-char *in, *out;
+callaurpc(struct vol *vol,
+    u_long prognum, u_long versnum, u_long procnum,
+    xdrproc_t inproc, char *in, 
+    xdrproc_t outproc, char *out)
 {
     enum clnt_stat clnt_stat;
     struct timeval tottimeout;
@@ -105,7 +90,7 @@ char *in, *out;
 #define GQR_RQUOTA getquota_rslt_u.gqr_rquota
 #endif /* USE_OLD_RQUOTA */
 
-int getnfsquota(struct vol *vol, const int uid, const u_int32_t bsize,
+int getnfsquota(struct vol *vol, const int uid, const uint32_t bsize,
                 struct dqblk *dqp)
 {
 
@@ -186,4 +171,4 @@ int getnfsquota(struct vol *vol, const int uid, const u_int32_t bsize,
     *hostpath = ':';
     return AFPERR_PARAM;
 }
-#endif /* ! NO_QUOTA_SUPPORT */
+#endif /* ! NO_QUOTA_SUPPORT && !HAVE_LIBQUOTA */