Module Name:    src
Committed By:   njoly
Date:           Fri Feb 24 18:00:09 UTC 2012

Modified Files:
        src/lib/libquota: quota_oldfiles.c

Log Message:
Check if fstab file exists before trying to parse it, to avoid
warnings from {get,set}fsent() functions if missing.

dholland ok.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/lib/libquota/quota_oldfiles.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libquota/quota_oldfiles.c
diff -u src/lib/libquota/quota_oldfiles.c:1.8 src/lib/libquota/quota_oldfiles.c:1.9
--- src/lib/libquota/quota_oldfiles.c:1.8	Wed Feb  1 06:12:37 2012
+++ src/lib/libquota/quota_oldfiles.c	Fri Feb 24 18:00:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: quota_oldfiles.c,v 1.8 2012/02/01 06:12:37 dholland Exp $	*/
+/*	$NetBSD: quota_oldfiles.c,v 1.9 2012/02/24 18:00:09 njoly Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: quota_oldfiles.c,v 1.8 2012/02/01 06:12:37 dholland Exp $");
+__RCSID("$NetBSD: quota_oldfiles.c,v 1.9 2012/02/24 18:00:09 njoly Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -205,6 +205,13 @@ __quota_oldfiles_load_fstab(void)
 	}
 
 	/*
+	 * Check if fstab file exists before trying to parse it.
+	 * Avoid warnings from {get,set}fsent() if missing.
+	 */
+	if (access(_PATH_FSTAB, F_OK) == -1 && errno == ENOENT)
+		return;
+
+	/*
 	 * XXX: should be able to handle ext2fs quota1 files too
 	 *
 	 * XXX: should use getfsent_r(), but there isn't one.

Reply via email to