summaryrefslogtreecommitdiff
path: root/quotasys.c
diff options
context:
space:
mode:
authorjkar8572 <jkar8572>2004-01-09 11:27:45 +0000
committerjkar8572 <jkar8572>2004-01-09 11:27:45 +0000
commit4a83cdf5b56528dddef46773d2540cc51ed45102 (patch)
tree27ca6f04383311fbe18a784066fdb1b7fae41d79 /quotasys.c
parentde63cc7548b8f9a53b17ebbdd6a5c077de926517 (diff)
Fixed bug in warnquota.conf parsing. (Jan Kara)
Reverted change in kernel detection via sysctl() - sysctl() obsoleted in 2.6 (Jan Kara)
Diffstat (limited to 'quotasys.c')
-rw-r--r--quotasys.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/quotasys.c b/quotasys.c
index 4e9a6ff..b0b24fb 100644
--- a/quotasys.c
+++ b/quotasys.c
@@ -21,7 +21,6 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/vfs.h>
-#include <sys/sysctl.h>
#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);
}