summaryrefslogtreecommitdiffstats
path: root/mh.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-12-11 20:20:41 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-12-11 20:20:41 +0000
commit8071e1e0120636d59b41c3f4714999d608dbc33e (patch)
tree26cce580777ee2c4ecd526eb4230bb45800796ce /mh.c
parent1a220aa0e832ff917c0c277d7769d025f1e23dea (diff)
Undoing the mh_speed patch.
Diffstat (limited to 'mh.c')
-rw-r--r--mh.c35
1 files changed, 1 insertions, 34 deletions
diff --git a/mh.c b/mh.c
index cf678f45..e5c3c04e 100644
--- a/mh.c
+++ b/mh.c
@@ -29,16 +29,12 @@ static const char rcsid[]="$Id$";
#include "sort.h"
#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
#include <dirent.h>
#include <limits.h>
#include <unistd.h>
#include <ctype.h>
#include <errno.h>
#include <string.h>
-#include <fcntl.h>
struct maildir
{
@@ -172,18 +168,10 @@ static int maildir_parse_entry(CONTEXT *ctx, struct maildir ***last,
HEADER *h;
char buf[_POSIX_PATH_MAX];
-#ifndef HAVE_FCHDIR
-
if(subdir)
snprintf(buf, sizeof(buf), "%s/%s/%s", ctx->path, subdir, fname);
else
snprintf(buf, sizeof(buf), "%s/%s", ctx->path, fname);
-
-#else
-
- strfcpy(buf, fname, sizeof(buf));
-
-#endif
if((h = maildir_parse_message(ctx->magic, buf, is_old)) != NULL)
{
@@ -235,10 +223,7 @@ static int maildir_parse_dir(CONTEXT *ctx, struct maildir ***last,
struct dirent *de;
char buf[_POSIX_PATH_MAX];
int is_old = 0;
-#ifdef HAVE_FCHDIR
- int fd;
-#endif
-
+
if(subdir)
{
snprintf(buf, sizeof(buf), "%s/%s", ctx->path, subdir);
@@ -246,26 +231,10 @@ static int maildir_parse_dir(CONTEXT *ctx, struct maildir ***last,
}
else
strfcpy(buf, ctx->path, sizeof(buf));
-
-#ifdef HAVE_FCHDIR
-
- if((fd = open(".", 0)) == -1)
- return -1;
-
- if((chdir(buf) == -1) || ((dirp = opendir(".")) == NULL))
- {
- fchdir(fd);
- close(fd);
- return -1;
- }
-#else
-
if((dirp = opendir(buf)) == NULL)
return -1;
-#endif
-
while ((de = readdir (dirp)) != NULL)
{
@@ -279,8 +248,6 @@ static int maildir_parse_dir(CONTEXT *ctx, struct maildir ***last,
}
closedir(dirp);
- fchdir(fd);
- close(fd);
return 0;
}