log_error(LOG_ARGS, "Could not open(%s/requeue)", list->dir);
return 1;
}
- if (fchdir(dirfd) < 0) {
- log_error(LOG_ARGS, "Could not chdir(%s/requeue)", list->dir);
- return 1;
- }
-
if ((queuedir = fdopendir(dirfd)) == NULL) {
log_error(LOG_ARGS, "Could not opendir(%s/requeue)", list->dir);
return 1;
/* Remove old empty directories */
t = time(NULL);
if(t - st.st_mtime > (time_t)3600)
- if(rmdir(dp->d_name) == 0)
+ if(unlinkat(dirfd, dp->d_name, AT_REMOVEDIR) == 0)
continue;
xasprintf(&archivefilename, "%s/archive/%s", list->dir,
log_error(LOG_ARGS, "Could not open(%s/requeue)", list->dir);
return 1;
}
- if (fchdir(dirfd) < 0) {
- log_error(LOG_ARGS, "Could not chdir(%s/requeue)", list->dir);
- return 1;
- }
if((bouncedir = fdopendir(dirfd)) == NULL) {
log_error(LOG_ARGS, "Could not opendir(%s/requeue)", list->dir);
int status;
int dirfd = openat(list->fd, "bounce", O_DIRECTORY);
if (dirfd == -1) {
- log_error(LOG_ARGS, "Could not chdir(%s/bounce)", list->dir);
- return 1;
- }
- if(fchdir(dirfd) < 0) {
- log_error(LOG_ARGS, "Could not chdir(%s/bounce)", list->dir);
+ log_error(LOG_ARGS, "Could not open(%s/bounce)", list->dir);
return 1;
}
if((bouncedir = fdopendir(dirfd)) == NULL) {
log_error(LOG_ARGS, "Could not chdir(%s/bounce)", list->dir);
return 1;
}
- if(fchdir(dirfd) < 0) {
- log_error(LOG_ARGS, "Could not chdir(%s/bounce)", list->dir);
- return 1;
- }
if((bouncedir = fdopendir(dirfd)) == NULL) {
log_error(LOG_ARGS, "Could not opendir(%s/bounce)", list->dir);
return 1;
return;
}
- if(chdir(listdir) < 0) {
- log_error(LOG_ARGS, "Could not chdir(%s). "
- "No maintenance run performed.", listdir);
- return;
- }
-
-
random = random_str();
xasprintf(&logname, "maintdlog-%s", random);
free(random);