#include <h/tws.h>
#include <h/mts.h>
#include <h/utils.h>
+#include "sbr/m_mktemp.h"
#define RCVDIST_SWITCHES \
X("form formfile", 4, FORMSW) \
main (int argc, char **argv)
{
pid_t child_id;
- int i, vecp;
+ int vecp;
char *addrs = NULL, *cp, *form = NULL, buf[BUFSIZ], *program;
char **argp, **arguments, **vec;
FILE *fp;
vec[vecp++] = drft;
vec[vecp] = NULL;
- for (i = 0; (child_id = fork()) == NOTOK && i < 5; i++)
- sleep (5);
+ child_id = fork();
switch (child_id) {
case NOTOK:
inform("unable to fork, continuing...");
charstring_t scanl;
struct comp *cptr;
FILE *out;
- m_getfld_state_t gstate = 0;
+ m_getfld_state_t gstate;
if (!(out = fopen (drft, "w")))
adios (drft, "unable to create");
if (cptr)
cptr->c_text = addrs;
+ gstate = m_getfld_state_init(inb);
for (;;) {
int msg_count = sizeof tmpbuf;
- switch (state = m_getfld (&gstate, name, tmpbuf, &msg_count, inb)) {
+ switch (state = m_getfld2(&gstate, name, tmpbuf, &msg_count)) {
case FLD:
case FLDPLUS:
i = fmt_addcomptext(name, tmpbuf);
char_read += msg_count;
while (state == FLDPLUS) {
msg_count = sizeof tmpbuf;
- state = m_getfld (&gstate, name, tmpbuf, &msg_count, inb);
+ state = m_getfld2(&gstate, name, tmpbuf, &msg_count);
fmt_appendcomp(i, name, tmpbuf);
char_read += msg_count;
}
while (state == FLDPLUS) {
msg_count = sizeof tmpbuf;
- state = m_getfld (&gstate, name, tmpbuf, &msg_count, inb);
+ state = m_getfld2(&gstate, name, tmpbuf, &msg_count);
}
break;
goto finished;
default:
- adios (NULL, "m_getfld() returned %d", state);
+ adios (NULL, "m_getfld2() returned %d", state);
}
}
finished: ;