Fixed failed point polls

This commit is contained in:
Michiel Broek 2003-12-26 12:25:25 +00:00
parent 32300e69df
commit 5ee3f80ba7
2 changed files with 29 additions and 21 deletions

View File

@ -6,6 +6,10 @@ v0.39.5 24-Dec-2003
Binkp code cleanup. Binkp code cleanup.
Allow m_file command in binkp during file transfer in progress. Allow m_file command in binkp during file transfer in progress.
mbout:
Poll, remove poll and request failed to points which had no
point directory in the outbound, now the directory is created.
script: script:
Fixed NetBSD init script Fixed NetBSD init script
All init scripts now clean the ~/var/run directory and start All init scripts now clean the ~/var/run directory and start

View File

@ -374,6 +374,7 @@ int poll(faddr *addr, int stop)
return 0; return 0;
pol = xstrcpy(polname(addr)); pol = xstrcpy(polname(addr));
mkdirs(pol, 0770);
if (stop) { if (stop) {
if (access(pol, R_OK) == 0) { if (access(pol, R_OK) == 0) {
@ -413,6 +414,8 @@ int poll(faddr *addr, int stop)
if ((fp = fopen(pol, "w+")) == NULL) { if ((fp = fopen(pol, "w+")) == NULL) {
WriteError("$Can't create poll for %s", ascfnode(addr, 0x1f)); WriteError("$Can't create poll for %s", ascfnode(addr, 0x1f));
if (!do_quiet)
printf("Can't create poll for %s\n", ascfnode(addr, 0x1f));
rc = MBERR_CANNOT_MAKE_POLL; rc = MBERR_CANNOT_MAKE_POLL;
} else { } else {
fclose(fp); fclose(fp);
@ -467,31 +470,32 @@ int reset(faddr *addr)
int freq(faddr *addr, char *fname) int freq(faddr *addr, char *fname)
{ {
char *req; char *req;
FILE *fp; FILE *fp;
Syslog('o', "Freq %s %s", ascfnode(addr, 0x1f), fname); Syslog('o', "Freq %s %s", ascfnode(addr, 0x1f), fname);
/* /*
* Append filename to .req file * Append filename to .req file
*/ */
req = xstrcpy(reqname(addr)); req = xstrcpy(reqname(addr));
if ((fp = fopen(req, "a")) == NULL) { mkdirs(req, 0770);
WriteError("$Can't append to %s", req); if ((fp = fopen(req, "a")) == NULL) {
if (!do_quiet) WriteError("$Can't append to %s", req);
printf("File request failed\n");
free(req);
return MBERR_REQUEST;
}
fprintf(fp, "%s\r\n", fname);
fclose(fp);
Syslog('+', "File request \"%s\" from %s", fname, ascfnode(addr, 0x1f));
if (!do_quiet) if (!do_quiet)
printf("File request \"%s\" from %s\n", fname, ascfnode(addr, 0x1f)); printf("File request failed\n");
free(req); free(req);
return 0; return MBERR_REQUEST;
}
fprintf(fp, "%s\r\n", fname);
fclose(fp);
Syslog('+', "File request \"%s\" from %s", fname, ascfnode(addr, 0x1f));
if (!do_quiet)
printf("File request \"%s\" from %s\n", fname, ascfnode(addr, 0x1f));
free(req);
return 0;
} }