]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Handle EDQUOT and ENOSPC errors
authorMark Andrews <marka@isc.org>
Tue, 26 Feb 2019 02:01:53 +0000 (13:01 +1100)
committerEvan Hunt <each@isc.org>
Fri, 8 Mar 2019 05:23:39 +0000 (21:23 -0800)
(cherry picked from commit 435ae2f29a87034ddcaa6abb2dcca47e024aa62f)

CHANGES
lib/isc/include/isc/result.h
lib/isc/result.c
lib/isc/unix/errno2result.c
lib/isc/win32/errno2result.c

diff --git a/CHANGES b/CHANGES
index b1c2f8123cfe244cb5e1f10a144abd252f1f4542..ae0bce881801fee49297293dc80728ea085a514c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+5178.  [bug]           Handle EDQUOT (disk quota) and ENOSPC (disk full)
+                       errors when writing files. [GL #902]
+
 5177.  [func]          Add the ability to specify in named.conf whether a
                        response-policy zone's SOA record should be added
                        to the additional section (add-soa yes/no). [GL #865]
index d0ece05570d1208efef7716aa559563e43b5f5ee..36792fa0dcbd3b7f8c9535d31f2bf081e765e6d8 100644 (file)
 #define ISC_R_WOULDBLOCK               63      /*%< would block */
 #define ISC_R_COMPLETE                 64      /*%< complete */
 #define ISC_R_CRYPTOFAILURE            65      /*%< cryptography library failure */
+#define ISC_R_DISCQUOTA                        66      /*%< disc quota */
+#define ISC_R_DISCFULL                 67      /*%< disc full */
 
 /*% Not a result code: the number of results. */
-#define ISC_R_NRESULTS                         66
+#define ISC_R_NRESULTS                         68
 
 ISC_LANG_BEGINDECLS
 
index 67a01187030c8b08017b6320592e2ec7e2edce65..7eb4284022a0a820427c68efa810a898ad1b1e7f 100644 (file)
@@ -99,6 +99,8 @@ static const char *description[ISC_R_NRESULTS] = {
        "would block",                          /*%< 63 */
        "complete",                             /*%< 64 */
        "crypto failure",                       /*%< 65 */
+       "disc quota",                           /*%< 66 */
+       "disc full",                            /*%< 67 */
 };
 
 static const char *identifier[ISC_R_NRESULTS] = {
@@ -168,6 +170,8 @@ static const char *identifier[ISC_R_NRESULTS] = {
        "ISC_R_WOULDBLOCK",
        "ISC_R_COMPLETE",
        "ISC_R_CRYPTOFAILURE",
+       "ISC_R_DISCQUOTA",
+       "ISC_R_DISCFULL",
 };
 
 #define ISC_RESULT_RESULTSET                   2
index d72d56f7e9cf280dd76a3d711fb982211319b9b7..35689e4722cd7eb93189b9b55092051adcb55d94 100644 (file)
@@ -57,6 +57,12 @@ isc___errno2result(int posixerrno, bool dolog,
        case ENFILE:
        case EMFILE:
                return (ISC_R_TOOMANYOPENFILES);
+#ifdef EDQUOT
+       case EDQUOT:
+               return (ISC_R_DISCQUOTA);
+#endif
+       case ENOSPC:
+               return (ISC_R_DISCFULL);
 #ifdef EOVERFLOW
        case EOVERFLOW:
                return (ISC_R_RANGE);
index d09fc2b233f4cacb84c3e8d4ee676e6a82c32109..59af4cae881c8fe56211d9858f0ffdb5abb1530a 100644 (file)
@@ -63,6 +63,8 @@ isc__errno2resultx(int posixerrno, bool dolog,
        case EMFILE:
        case WSAEMFILE:
                return (ISC_R_TOOMANYOPENFILES);
+       case ENOSPC:
+               return (ISC_R_DISCFULL);
        case ERROR_CANCELLED:
                return (ISC_R_CANCELED);
        case ERROR_CONNECTION_REFUSED: