]> 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:29:59 +0000 (21:29 -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 3a82ed2b420e83b86cf04819267ada4002d60cc8..5d6759b103f34fa9d807382de85b95f8c8650b0f 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]
+
 5176.  [tests]         Remove a dependency on libxml in statschannel system
                        test. [GL #926]
 
index 246aefba511a19a8449de1cb6bb3b7835bd57c31..0fd4971d8b4d83d5f358bd44d71b236fc7c4eacb 100644 (file)
 #define ISC_R_UNSET                    61      /*%< unset */
 #define ISC_R_MULTIPLE                 62      /*%< multiple */
 #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                         64
+#define ISC_R_NRESULTS                         68
 
 ISC_LANG_BEGINDECLS
 
index a707c32a28e86b5ee0f8f6bb811086e01a4abce6..abb6ed26a677b41889f74c074fd2e8013d9fda22 100644 (file)
@@ -99,6 +99,10 @@ static const char *description[ISC_R_NRESULTS] = {
        "unset",                                /*%< 61 */
        "multiple",                             /*%< 62 */
        "would block",                          /*%< 63 */
+       "complete",                             /*%< 64 */
+       "crypto failure",                       /*%< 65 */
+       "disc quota",                           /*%< 66 */
+       "disc full",                            /*%< 67 */
 };
 
 static const char *identifier[ISC_R_NRESULTS] = {
@@ -166,6 +170,10 @@ static const char *identifier[ISC_R_NRESULTS] = {
        "ISC_R_UNSET",
        "ISC_R_MULTIPLE",
        "ISC_R_WOULDBLOCK",
+       "ISC_R_COMPLETE",
+       "ISC_R_CRYPTOFAILURE",
+       "ISC_R_DISCQUOTA",
+       "ISC_R_DISCFULL",
 };
 
 #define ISC_RESULT_RESULTSET                   2
index 2f12bcc8bc0f0326ae25202f7e604cf60f616436..32502e046c4fd7829c5a9d95d0705ea1b300d1e7 100644 (file)
@@ -55,6 +55,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 83dbb4e4e397f8d0a73fb8327fe2084eef58a0af..1123247037816d3b05653e5f84e4d480a126ccff 100644 (file)
@@ -62,6 +62,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: