From 4a83cdf5b56528dddef46773d2540cc51ed45102 Mon Sep 17 00:00:00 2001 From: jkar8572 Date: Fri, 9 Jan 2004 11:27:45 +0000 Subject: Fixed bug in warnquota.conf parsing. (Jan Kara) Reverted change in kernel detection via sysctl() - sysctl() obsoleted in 2.6 (Jan Kara) --- quotasys.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'quotasys.c') diff --git a/quotasys.c b/quotasys.c index 4e9a6ff..b0b24fb 100644 --- a/quotasys.c +++ b/quotasys.c @@ -21,7 +21,6 @@ #include #include #include -#include #include "pot.h" #include "bylabel.h" @@ -598,7 +597,6 @@ void init_kernel_interface(void) { struct stat st; struct sigaction sig, oldsig; - int ctlname[] = {CTL_FS, FS_DQSTATS, FS_DQ_SYNCS}; /* This signal handling is needed because old kernels send us SIGSEGV as they try to resolve the device */ sig.sa_handler = SIG_IGN; @@ -615,7 +613,8 @@ void init_kernel_interface(void) else if (!quotactl(QCMD(Q_XGETQSTAT, 0), NULL, 0, NULL) || (errno != EINVAL && errno != ENOSYS)) kernel_formats |= (1 << QF_XFS); - if (!sysctl(ctlname, sizeof(ctlname)/sizeof(int), NULL, NULL, NULL, 0)) { + /* Detect new kernel interface; Assume generic interface unless we can prove there is not one... */ + if (!stat("/proc/sys/fs/quota", &st) || errno != ENOENT) { kernel_iface = IFACE_GENERIC; kernel_formats |= (1 << QF_VFSOLD) | (1 << QF_VFSV0); } -- cgit v1.2.3