2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 15:05:23 +00:00

1011. [cleanup] Removed isc_dir_current().

This commit is contained in:
Andreas Gustafsson
2001-09-20 21:21:53 +00:00
parent f1491358ff
commit 1299e93989
6 changed files with 45 additions and 88 deletions

View File

@@ -1,4 +1,6 @@
1011. [cleanup] Removed isc_dir_current().
1010. [bug] The server could attempt to execute a command channel
command after initiating server shutdown, causing
an assertion failure. [RT #1766]
@@ -2471,7 +2473,7 @@
257. [bug] The server detached the last zone manager reference
too early, while it could still be in use by queries.
This manifested itself as assertion failures during the
shutdown process for busy name servers [RT #133].
shutdown process for busy name servers. [RT #133]
256. [func] isc_ratelimiter_t now has attach/detach semantics, and
isc_ratelimiter_shutdown guarantees that the rate

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dir.c,v 1.18 2001/06/08 23:50:31 tale Exp $ */
/* $Id: dir.c,v 1.19 2001/09/20 21:21:48 gson Exp $ */
/* Principal Authors: DCL */
@@ -155,34 +155,6 @@ isc_dir_chroot(const char *dirname) {
return (ISC_R_SUCCESS);
}
isc_result_t
isc_dir_current(char *dirname, size_t length, isc_boolean_t end_sep) {
char *cwd;
isc_result_t result = ISC_R_SUCCESS;
/*
* XXXDCL Could automatically allocate memory if dirname == NULL.
*/
REQUIRE(dirname != NULL);
REQUIRE(length > 0);
cwd = getcwd(dirname, length);
if (cwd == NULL) {
if (errno == ERANGE)
result = ISC_R_NOSPACE;
else
result = isc__errno2result(errno);
} else if (end_sep) {
if (strlen(dirname) + 1 == length)
result = ISC_R_NOSPACE;
else if (dirname[1] != '\0')
strcat(dirname, "/");
}
return (result);
}
isc_result_t
isc_dir_createunique(char *templet) {
isc_result_t result;

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: file.c,v 1.40 2001/08/30 20:55:37 gson Exp $ */
/* $Id: file.c,v 1.41 2001/09/20 21:21:49 gson Exp $ */
#include <config.h>
@@ -301,10 +301,41 @@ isc_file_progname(const char *filename, char *buf, size_t buflen) {
return (ISC_R_SUCCESS);
}
/*
* Put the absolute name of the current directory into 'dirname', which is
* a buffer of at least 'length' characters. End the string with the
* appropriate path separator, such that the final product could be
* concatenated with a relative pathname to make a valid pathname string.
*/
static isc_result_t
dir_current(char *dirname, size_t length) {
char *cwd;
isc_result_t result = ISC_R_SUCCESS;
REQUIRE(dirname != NULL);
REQUIRE(length > 0);
cwd = getcwd(dirname, length);
if (cwd == NULL) {
if (errno == ERANGE)
result = ISC_R_NOSPACE;
else
result = isc__errno2result(errno);
} else {
if (strlen(dirname) + 1 == length)
result = ISC_R_NOSPACE;
else if (dirname[1] != '\0')
strcat(dirname, "/");
}
return (result);
}
isc_result_t
isc_file_absolutepath(const char *filename, char *path, size_t pathlen) {
isc_result_t result;
result = isc_dir_current(path, pathlen, ISC_TRUE);
result = dir_current(path, pathlen);
if (result != ISC_R_SUCCESS)
return (result);
if (strlen(path) + strlen(filename) + 1 > pathlen)

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dir.h,v 1.15 2001/08/28 03:58:27 marka Exp $ */
/* $Id: dir.h,v 1.16 2001/09/20 21:21:50 gson Exp $ */
/* Principal Authors: DCL */
@@ -76,16 +76,6 @@ isc_dir_chdir(const char *dirname);
isc_result_t
isc_dir_chroot(const char *dirname);
isc_result_t
isc_dir_current(char *dirname, size_t length, isc_boolean_t end_sep);
/*
* Put the absolute name of the current directory into 'dirname', which is a
* buffer of at least 'length' characters. If 'end_sep' is true, end the
* string with the appropriate path separator, such that the final product
* could be concatenated with a relative pathname to make a valid pathname
* string.
*/
isc_result_t
isc_dir_createunique(char *templet);
/*

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dir.c,v 1.10 2001/07/06 21:47:15 gson Exp $ */
/* $Id: dir.c,v 1.11 2001/09/20 21:21:52 gson Exp $ */
/* Principal Authors: DCL */
@@ -245,34 +245,6 @@ isc_dir_chroot(const char *dirname) {
return (ISC_R_SUCCESS);
}
isc_result_t
isc_dir_current(char *dirname, size_t length, isc_boolean_t end_sep) {
char *cwd;
isc_result_t result = ISC_R_SUCCESS;
/*
* XXXDCL Could automatically allocate memory if dirname == NULL.
*/
REQUIRE(dirname != NULL);
REQUIRE(length > 0);
cwd = getcwd(dirname, length);
if (cwd == NULL) {
if (errno == ERANGE)
result = ISC_R_NOSPACE;
else
result = isc__errno2result(errno);
} else if (end_sep) {
if (strlen(dirname) + 1 == length)
result = ISC_R_NOSPACE;
else if (dirname[1] != '\0')
strcat(dirname, "/");
}
return (result);
}
isc_result_t
isc_dir_createunique(char *templet) {
isc_result_t result;

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dir.h,v 1.11 2001/08/28 03:58:29 marka Exp $ */
/* $Id: dir.h,v 1.12 2001/09/20 21:21:53 gson Exp $ */
/* Principal Authors: DCL */
@@ -69,16 +69,6 @@ isc_dir_chdir(const char *dirname);
isc_result_t
isc_dir_chroot(const char *dirname);
isc_result_t
isc_dir_current(char *dirname, size_t length, isc_boolean_t end_sep);
/*
* Put the absolute name of the current directory into 'dirname', which is a
* buffer of at least 'length' characters. If 'end_sep' is true, end the
* string with the appropriate path separator, such that the final product
* could be concatenated with a relative pathname to make a valid pathname
* string.
*/
isc_result_t
isc_dir_createunique(char *templet);
/*