Changeset: fa25d728c673 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fa25d728c673
Modified Files:
pathfinder/runtime/shttpd.c
Branch: default
Log Message:
Removed now superfluous version of opendir.
We now use the copy of opendir in the mutils library, so we don't need
one here anymore.
The versions were not identical, and I don't know which was better...
diffs (87 lines):
diff --git a/pathfinder/runtime/shttpd.c b/pathfinder/runtime/shttpd.c
--- a/pathfinder/runtime/shttpd.c
+++ b/pathfinder/runtime/shttpd.c
@@ -657,83 +657,6 @@
*dst = '\0';
}
-#if defined(_WIN32) && !defined(__GNUC__) || defined(__MINGW32__)
-/*
- * POSIX directory management (limited implementation, enough for shttpd)
- */
-static DIR *
-opendir(const char *name)
-{
- DIR *dir = NULL;
- size_t base_length;
- const char *all;
-
- if (name && name[0]) {
- base_length = strlen(name);
- all = strchr("/\\", name[base_length - 1]) ? "*" : "/*";
-
- if ((dir = malloc(sizeof *dir)) != NULL &&
- (dir->name = malloc(base_length + strlen(all) + 1)) != 0) {
- (void) strcat(strcpy(dir->name, name), all);
-
- if ((dir->handle = (long) _findfirst(dir->name,
- &dir->info)) != -1) {
- dir->result.d_name = 0;
- } else {
- free(dir->name);
- free(dir);
- dir = 0;
- }
- } else {
- free(dir);
- dir = NULL;
- errno = ENOMEM;
- }
- } else {
- errno = EINVAL;
- }
-
- return (dir);
-}
-
-static int
-closedir(DIR *dir)
-{
- int result = -1;
-
- if (dir) {
- if(dir->handle != -1)
- result = _findclose(dir->handle);
-
- free(dir->name);
- free(dir);
- }
-
- if (result == -1)
- errno = EBADF;
-
- return (result);
-}
-
-static struct dirent *
-readdir(DIR *dir)
-{
- struct dirent *result = 0;
-
- if (dir && dir->handle != -1) {
- if(!dir->result.d_name ||
- _findnext(dir->handle, &dir->info) != -1) {
- result = &dir->result;
- result->d_name = dir->info.name;
- }
- } else {
- errno = EBADF;
- }
-
- return (result);
-}
-#endif /* _WIN32 */
-
/*
* Log function
*/
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list