Updates for directory tossing

This commit is contained in:
Michiel Broek
2002-11-11 12:56:19 +00:00
parent db83218bc7
commit b314568630
4 changed files with 35 additions and 3 deletions

View File

@@ -140,13 +140,18 @@ void remlock(char *lockfile, int create, int loglvl)
void dirinbound(void)
/*
* Process directory inbound. Return TRUE if something is moved
* to the inbound for processing.
*/
int dirinbound(void)
{
FILE *fp;
char *temp, *from, *too;
long fileptr;
struct dirent *de;
DIR *dp;
int Something = FALSE;
Syslog('m', "Starting directory inbound sessions");
@@ -188,6 +193,9 @@ void dirinbound(void)
Syslog('m', "Move %s to %s", from, too);
if (file_mv(from, too)) {
WriteError("$Move %s to %s failed", from, too);
} else {
Something = TRUE;
Syslog('+', "Moved \"%s\" to %s", de->d_name, do_unprot ? CFG.inbound : CFG.pinbound);
}
}
}
@@ -211,6 +219,7 @@ void dirinbound(void)
}
free(temp);
Syslog('m', "Finished directory inbound sessions");
return Something;
}

View File

@@ -7,6 +7,6 @@
int islocked(char *, int, int, int); /* Is directory locked */
int setlock(char *, int, int); /* Lock directory */
void remlock(char *, int, int); /* Unlock directory */
void dirinbound(void); /* Process nodes */
int dirinbound(void); /* Process nodes */
#endif

View File

@@ -566,7 +566,28 @@ int main(int argc, char **argv)
/*
* Do inbound direcory sessions
*/
dirinbound();
if (dirinbound()) {
if (do_tic) {
/*
* Hatch new files and process .tic files
* until nothing left to do.
*/
Loop = TRUE;
do {
Hatch();
switch (Tic()) {
case -1: die(MBERR_OK);
break;
case 0: Loop = FALSE;
break;
default: break;
}
} while (Loop);
}
if (do_toss) {
TossMail();
}
}
}
if (!do_uucp)
newspost();