*
*/
-
-/* FIXME
-
-there's stuff in here that makes the assumption that /tmp is on the same
-filesystem as Citadel, and makes calls to link() on that basis. fix this.
-
-*/
-
#include "sysdep.h"
#include <stdlib.h>
#include <unistd.h>
void cmd_gnet(char *argbuf) {
- char filename[256];
- char buf[256];
+ char filename[SIZ];
+ char buf[SIZ];
FILE *fp;
if (CtdlAccessCheck(ac_room_aide)) return;
void cmd_snet(char *argbuf) {
- char tempfilename[256];
- char filename[256];
- char buf[256];
+ char tempfilename[SIZ];
+ char filename[SIZ];
+ char buf[SIZ];
FILE *fp;
if (CtdlAccessCheck(ac_room_aide)) return;
}
fclose(fp);
- /* Now that we've got the whole file, put it in place */
+ /* Now copy the temp file to its permanent location
+ * (We use /bin/mv instead of link() because they may be on
+ * different filesystems)
+ */
unlink(filename);
- link(tempfilename, filename);
- unlink(tempfilename);
+ snprintf(buf, sizeof buf, "/bin/mv %s %s", tempfilename, filename);
+ system(buf);
}
/* Generate delivery instructions for each recipient */
for (nptr = sc->listrecps; nptr != NULL; nptr = nptr->next) {
- if (instr_len - strlen(instr) < 256) {
+ if (instr_len - strlen(instr) < SIZ) {
instr_len = instr_len * 2;
instr = reallok(instr, instr_len);
}
* Batch up and send all outbound traffic from the current room
*/
void network_spoolout_current_room(void) {
- char filename[256];
- char buf[256];
- char instr[256];
+ char filename[SIZ];
+ char buf[SIZ];
+ char instr[SIZ];
FILE *fp;
struct SpoolControl sc;
/* struct namelist *digestrecps = NULL; */
/* Do something useful */
- CtdlForEachMessage(MSGS_ALL, 0L, (-63), NULL, NULL,
+ CtdlForEachMessage(MSGS_GT, sc.lastsent, (-63), NULL, NULL,
network_spool_msg, &sc);