From 5ac7e43ea7216589b6762e65bcb5488fa37ddcbf Mon Sep 17 00:00:00 2001 From: mpp Date: Sun, 16 Sep 2007 02:59:32 +0000 Subject: Fix "quotacheck -a" from core dumping on 64 bit systems by correctly declaring the return value used by the routines in preen.c as a pointer type, instead of "int", which was causing the pointer to be truncated. Tested by: marck Approved by: re (bmah) --- sbin/quotacheck/preen.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'sbin') diff --git a/sbin/quotacheck/preen.c b/sbin/quotacheck/preen.c index 93ce142..7856091 100644 --- a/sbin/quotacheck/preen.c +++ b/sbin/quotacheck/preen.c @@ -57,7 +57,7 @@ struct part { struct part *next; /* forward link of partitions on disk */ char *name; /* device name */ char *fsname; /* mounted file system name */ - long auxdata; /* auxiliary data for application */ + void *auxdata; /* auxiliary data for application */ } *badlist, **badnext = &badlist; struct disk { @@ -69,19 +69,20 @@ struct disk { int nrun, ndisks; -static void addpart(char *name, char *fsname, long auxdata); +static void addpart(char *name, char *fsname, void *auxdata); static struct disk *finddisk(char *name); -static int startdisk(struct disk *dk,int (*checkit)(char *, char *, long, int)); +static int startdisk(struct disk *dk, + int (*checkit)(char *, char *, void *, int)); int -checkfstab(int preen, int maxrun, int (*docheck)(struct fstab *), - int (*chkit)(char *, char *, long, int)) +checkfstab(int preen, int maxrun, void *(*docheck)(struct fstab *), + int (*chkit)(char *, char *, void *, int)) { struct fstab *fsp; struct disk *dk, *nextdisk; struct part *pt; int ret, pid, retcode, passno, sumstatus, status; - long auxdata; + void *auxdata; char *name; sumstatus = 0; @@ -92,7 +93,7 @@ checkfstab(int preen, int maxrun, int (*docheck)(struct fstab *), return (8); } while ((fsp = getfsent()) != 0) { - if ((auxdata = (*docheck)(fsp)) == 0) + if ((auxdata = (*docheck)(fsp)) == NULL) continue; if (preen == 0 || (passno == 1 && fsp->fs_passno == 1)) { @@ -235,7 +236,7 @@ finddisk(char *name) } static void -addpart(char *name, char *fsname, long auxdata) +addpart(char *name, char *fsname, void *auxdata) { struct disk *dk = finddisk(name); struct part *pt, **ppt = &dk->part; @@ -265,7 +266,7 @@ addpart(char *name, char *fsname, long auxdata) } static int -startdisk(struct disk *dk, int (*checkit)(char *, char *, long, int)) +startdisk(struct disk *dk, int (*checkit)(char *, char *, void *, int)) { struct part *pt = dk->part; -- cgit v1.1