summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2019-03-29 11:39:33 +0100
committerJan Kara <jack@suse.cz>2019-03-29 11:39:33 +0100
commit606d9b8a5debcc520d872e11d980e79494cf91d7 (patch)
tree8fa3080ce7d31a4b91ed3c70c6a2f00153220a6a
parent5d30a29f3ae289ce87b99bf17b99d204ab307cf1 (diff)
parentb54d97d677481287faa5d6b98c92f111141c1af3 (diff)
downloadquota-tools-606d9b8a5debcc520d872e11d980e79494cf91d7.tar.gz
Merge type and build cleanups from Fabrice Fontaine
-rw-r--r--bylabel.c45
-rw-r--r--configure.ac10
-rw-r--r--dqblk_v2.h1
-rw-r--r--quot.c17
-rw-r--r--quot.h14
-rw-r--r--quota.h1
-rw-r--r--rquota_server.c2
7 files changed, 47 insertions, 43 deletions
diff --git a/bylabel.c b/bylabel.c
index 5313461..069c3a1 100644
--- a/bylabel.c
+++ b/bylabel.c
@@ -20,6 +20,7 @@
#include <ctype.h>
#include <fcntl.h>
#include <unistd.h>
+#include <stdint.h>
#include "bylabel.h"
#include "common.h"
@@ -37,41 +38,41 @@ static struct uuidCache_s {
#define EXT2_SUPER_MAGIC 0xEF53
struct ext2_super_block {
- u_char s_dummy1[56];
- u_char s_magic[2];
- u_char s_dummy2[46];
- u_char s_uuid[16];
- u_char s_volume_name[16];
+ uint8_t s_dummy1[56];
+ uint8_t s_magic[2];
+ uint8_t s_dummy2[46];
+ uint8_t s_uuid[16];
+ uint8_t s_volume_name[16];
};
-#define ext2magic(s) ((uint) s.s_magic[0] + (((uint) s.s_magic[1]) << 8))
+#define ext2magic(s) ((uint32_t) s.s_magic[0] + (((uint32_t) s.s_magic[1]) << 8))
#define XFS_SUPER_MAGIC "XFSB"
#define XFS_SUPER_MAGIC2 "BSFX"
#define EXFS_SUPER_MAGIC "EXFS"
struct xfs_super_block {
- u_char s_magic[4];
- u_char s_dummy[28];
- u_char s_uuid[16];
- u_char s_dummy2[60];
- u_char s_fsname[12];
+ uint8_t s_magic[4];
+ uint8_t s_dummy[28];
+ uint8_t s_uuid[16];
+ uint8_t s_dummy2[60];
+ uint8_t s_fsname[12];
};
#define REISER_SUPER_MAGIC "ReIsEr2Fs"
struct reiserfs_super_block {
- u_char s_dummy1[52];
- u_char s_magic[10];
- u_char s_dummy2[22];
- u_char s_uuid[16];
- u_char s_volume_name[16];
+ uint8_t s_dummy1[52];
+ uint8_t s_magic[10];
+ uint8_t s_dummy2[22];
+ uint8_t s_uuid[16];
+ uint8_t s_volume_name[16];
};
#define F2FS_SUPER_MAGIC "0xF2F52010"
struct f2fs_super_block {
- u_char s_magic[8];
- u_char s_dummy[144];
- u_char s_uuid[16];
- u_char s_volume_name[512];
+ uint8_t s_magic[8];
+ uint8_t s_dummy[144];
+ uint8_t s_uuid[16];
+ uint8_t s_volume_name[512];
};
static inline unsigned short swapped(unsigned short a)
@@ -242,7 +243,7 @@ static char *get_spec_by_x(int n, const char *t)
return NULL;
}
-static u_char fromhex(char c)
+static uint8_t fromhex(char c)
{
if (isdigit(c))
return (c - '0');
@@ -254,7 +255,7 @@ static u_char fromhex(char c)
static char *get_spec_by_uuid(const char *s)
{
- u_char uuid[16];
+ uint8_t uuid[16];
int i;
if (strlen(s) != 36 || s[8] != '-' || s[13] != '-' || s[18] != '-' || s[23] != '-')
diff --git a/configure.ac b/configure.ac
index 04eabe4..2617e0a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -104,13 +104,13 @@ AC_ARG_ENABLE([ext2direct],
)
AS_IF([test "x$enable_ext2direct" != "xno"], [
build_ext2direct="yes"
- PKG_CHECK_MODULES([COM_ERR],[com_err], [], [
+ PKG_CHECK_MODULES([COM_ERR],[com_err], [CFLAGS="$CFLAGS $COM_ERR_CFLAGS" LIBS="$LIBS $COMM_ERR_LIBS"], [
build_ext2direct="no"
AS_IF([test "x$enable_ext2direct" = "xyes"], [
AC_MSG_ERROR([Ext2direct requested but required com_err library not found])
])
])
- PKG_CHECK_MODULES([EXT2FS],[ext2fs], [], [
+ PKG_CHECK_MODULES([EXT2FS],[ext2fs], [CFLAGS="$CFLAGS $EXT2FS_CFLAGS" LIBS="$LIBS $EXT2FS_LIBS"], [
build_ext2direct="no"
AS_IF([test "x$enable_ext2direct" = "xyes"], [
AC_MSG_ERROR([Ext2direct requested but required ext2fs library not found])
@@ -138,13 +138,13 @@ AC_ARG_ENABLE([netlink],
)
AS_IF([test "x$enable_netlink" != "xno"], [
build_netlink="yes"
- PKG_CHECK_MODULES([DBUS], [dbus-1], [], [
+ PKG_CHECK_MODULES([DBUS], [dbus-1], [CFLAGS="$CFLAGS $DBUS_CFLAGS" LIBS="$LIBS $DBUS_LIBS"], [
build_netlink="no"
AS_IF([test "x$enable_netlink" = "xyes"] , [
AC_MSG_ERROR([Required dbus libraries for quota netlink daemon not found.])
])
])
- PKG_CHECK_MODULES([LIBNL3], [libnl-3.0 >= 3.1 libnl-genl-3.0], [], [
+ PKG_CHECK_MODULES([LIBNL3], [libnl-3.0 >= 3.1 libnl-genl-3.0], [CFLAGS="$CFLAGS $LIBNL3_CFLAGS" LIBS="$LIBS $LIBNL3_LIBS"], [
build_netlink="no"
AS_IF([test "x$enable_netlink" = "xyes"] , [
AC_MSG_ERROR([Required libnl3 libraries for quota netlink daemon not found.])
@@ -207,7 +207,7 @@ AS_IF([test x"$enable_rpc" != "xno"], [
build_rpc="no"
])
- PKG_CHECK_MODULES([TIRPC], [libtirpc], [], [
+ PKG_CHECK_MODULES([TIRPC], [libtirpc], [CFLAGS="$CFLAGS $TIRPC_CFLAGS" LIBS="$LIBS $TIRPC_LIBS"], [
AS_IF([test x"$enable_rpc" = "xyes"], [
AC_MSG_ERROR([could not locate required libtirpc])
], [
diff --git a/dqblk_v2.h b/dqblk_v2.h
index c06168d..67ad9f2 100644
--- a/dqblk_v2.h
+++ b/dqblk_v2.h
@@ -8,6 +8,7 @@
#define GUARD_DQBLK_V2_H
#include <sys/types.h>
+#include <fcntl.h>
#include "quota_tree.h"
#define Q_V2_GETQUOTA 0x0D00 /* Get limits and usage */
diff --git a/quot.c b/quot.c
index c3a31a4..380536a 100644
--- a/quot.c
+++ b/quot.c
@@ -47,6 +47,7 @@
#include <utmp.h>
#include <pwd.h>
#include <grp.h>
+#include <stdint.h>
#include "pot.h"
#include "quot.h"
@@ -56,8 +57,8 @@
#include "quotasys.h"
#define TSIZE 500
-static __uint64_t sizes[TSIZE];
-static __uint64_t overflow;
+static uint64_t sizes[TSIZE];
+static uint64_t overflow;
static int aflag;
static int cflag;
@@ -72,7 +73,7 @@ static time_t now;
char *progname;
static void mounttable(void);
-static char *idname(__uint32_t, int);
+static char *idname(uint32_t, int);
static void report(const char *, const char *, int);
static void creport(const char *, const char *);
@@ -174,7 +175,7 @@ static int qcmp(du_t * p1, du_t * p2)
static void creport(const char *file, const char *fsdir)
{
int i;
- __uint64_t t = 0;
+ uint64_t t = 0;
printf(_("%s (%s):\n"), file, fsdir);
for (i = 0; i < TSIZE - 1; i++)
@@ -220,7 +221,7 @@ static void report(const char *file, const char *fsdir, int type)
}
}
-static idcache_t *getnextent(int type, __uint32_t id, int byid)
+static idcache_t *getnextent(int type, uint32_t id, int byid)
{
struct passwd *pw;
struct group *gr;
@@ -241,7 +242,7 @@ static idcache_t *getnextent(int type, __uint32_t id, int byid)
return &idc;
}
-static char *idname(__uint32_t id, int type)
+static char *idname(uint32_t id, int type)
{
idcache_t *ncp, *idp;
static idcache_t nc[2][NID];
@@ -287,8 +288,8 @@ static void acctXFS(xfs_bstat_t *p)
{
register du_t *dp;
du_t **hp;
- __uint64_t size;
- __uint32_t i, id;
+ uint64_t size;
+ uint32_t i, id;
if ((p->bs_mode & S_IFMT) == 0)
return;
diff --git a/quot.h b/quot.h
index 07ea39d..0d9110e 100644
--- a/quot.h
+++ b/quot.h
@@ -35,18 +35,18 @@
#define SEC24HR (60*60*24) /* seconds per day */
typedef struct {
- __uint32_t id;
+ uint32_t id;
char name[UT_NAMESIZE + 1];
} idcache_t;
typedef struct du {
struct du *next;
- __uint64_t blocks;
- __uint64_t blocks30;
- __uint64_t blocks60;
- __uint64_t blocks90;
- __uint64_t nfiles;
- __uint32_t id;
+ uint64_t blocks;
+ uint64_t blocks30;
+ uint64_t blocks60;
+ uint64_t blocks90;
+ uint64_t nfiles;
+ uint32_t id;
} du_t;
#define NDU 60000
diff --git a/quota.h b/quota.h
index 3628614..4c21411 100644
--- a/quota.h
+++ b/quota.h
@@ -1,6 +1,7 @@
#ifndef GUARD_QUOTA_H
#define GUARD_QUOTA_H
+#include <sys/cdefs.h>
#include <sys/types.h>
#include <stdint.h>
diff --git a/rquota_server.c b/rquota_server.c
index 09cf6ed..a72ad3f 100644
--- a/rquota_server.c
+++ b/rquota_server.c
@@ -60,7 +60,7 @@ extern char nfs_pseudoroot[PATH_MAX];
*/
extern struct authunix_parms *unix_cred;
-int in_group(gid_t * gids, u_int len, gid_t gid)
+int in_group(gid_t * gids, uint32_t len, gid_t gid)
{
gid_t *gidsp = gids + len;