2000-02-10 Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+ * fixinc/server.c (load_data): Return NULL if the marker line is
+ not found.
+ (run_shell): If load_data returns NULL, retry the command once, in
+ a new shell.
+
* configure: Rebuilt.
2000-02-09 Bruce Korb <bkorb@gnu.org>
size_t text_size;
char *pz_scan;
char z_line[1024];
+ t_bool got_done = BOOL_FALSE;
text_size = sizeof (z_line) * 2;
pz_scan = pz_text = malloc (text_size);
break;
if (strncmp (z_line, z_done, sizeof (z_done) - 1) == 0)
- break;
+ {
+ got_done = BOOL_TRUE;
+ break;
+ }
strcpy (pz_scan, z_line);
pz_scan += strlen (z_line);
}
alarm (0);
- if (read_pipe_timeout)
+ if (read_pipe_timeout || ! got_done)
{
free ((void *) pz_text);
return (char *) NULL;
run_shell (pz_cmd)
const char *pz_cmd;
{
+ t_bool retry = BOOL_TRUE;
+
+ do_retry:
/* IF the shell server process is not running yet,
THEN try to start it. */
if (server_id == NULLPROCESS)
if (pz == (char *) NULL)
{
+ close_server ();
+
+ if (retry)
+ {
+ retry = BOOL_FALSE;
+ goto do_retry;
+ }
+
fprintf (stderr, "CLOSING SHELL SERVER - command failure:\n\t%s\n",
pz_cmd);
- close_server ();
pz = (char *) malloc (1);
if (pz != (char *) NULL)
*pz = '\0';