+Thu May 20 07:06:39 1999 Alexandre Oliva <aoliva@acm.org>
+
+ * fixinc/Makefile.in(gnu-regex.o): add $(INCLUDES) to compile options
+ * fixinc/fixincl.c(wait_for_pid): K&R-ify arguments
+ (several places): omit static initialization
+ (process): use single fd, since only the read fd is used
+ * fixinc/gnu-regex.c: define 'const' away, if not supported
+ * fixinc/procopen.c(several places): omit static initialization
+ * fixinc/server.c: define 'volitile' away, if not supported
+
1999-05-20 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
* config/dbxcoff.h (DBX_OUTPUT_MAIN_SOURCE_FILE_END): Use
#endif
#define NAME_TABLE_SIZE (MINIMUM_MAXIMUM_LINES * MAXPATHLEN)
+#ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+#endif
+#ifndef EXIT_FAILURE
+# define EXIT_FAILURE 1
+#endif
+
char *file_name_buf;
#define tSCC static const char
`waitpid(2)'. We also ensure that the children exit with success. */
void
-wait_for_pid( pid_t child, int file_name_ct )
+wait_for_pid(child, file_name_ct)
+ pid_t child;
+ int file_name_ct;
{
for (;;) {
int status;
char *pz_data;
const char *pz_file_name;
{
- static char env_current_file[1024] = { "file=" };
+ static char env_current_file[1024];
tFixDesc *p_fixd = fixDescList;
int todo_ct = FIX_COUNT;
- t_fd_pair fdp = { -1, -1 };
+ int read_fd = -1;
int num_children = 0;
/* IF this is the first time through,
THEN put the 'file' environment variable into the environment.
This is used by some of the subject shell scripts and tests. */
- if (env_current_file[5] == NUL)
+ if (env_current_file[0] == NUL) {
+ strcpy (env_current_file, "file=");
putenv (env_current_file);
+ }
/*
Ghastly as it is, this actually updates the value of the variable:
the first fix. Any subsequent fixes will use the
stdout descriptor of the previous fix as its stdin. */
- if (fdp.read_fd == -1)
+ if (read_fd == -1)
{
- fdp.read_fd = open (pz_file_name, O_RDONLY);
- if (fdp.read_fd < 0)
+ read_fd = open (pz_file_name, O_RDONLY);
+ if (read_fd < 0)
{
fprintf (stderr, "Error %d (%s) opening %s\n", errno,
strerror (errno), pz_file_name);
}
/* This loop should only cycle for 1/2 of one loop.
- "chain_open" starts a process that uses "fdp.read_fd" as
+ "chain_open" starts a process that uses "read_fd" as
its stdin and returns the new fd this process will use
for stdout. */
{
tSCC z_err[] = "Error %d (%s) starting filter process for %s\n";
static int failCt = 0;
- int fd = chain_open (fdp.read_fd,
+ int fd = chain_open (read_fd,
(t_pchar *) p_fixd->patch_args,
(process_chain_head == -1)
? &process_chain_head : (pid_t *) NULL);
if (fd != -1)
{
- fdp.read_fd = fd;
+ read_fd = fd;
num_children++;
break;
}
/* IF after all the tests we did not start any patch programs,
THEN quit now. */
- if (fdp.read_fd < 0)
+ if (read_fd < 0)
return;
/* OK. We have work to do. Read back in the output
output of the filter chain.
*/
{
- FILE *in_fp = fdopen (fdp.read_fd, "r");
+ FILE *in_fp = fdopen (read_fd, "r");
FILE *out_fp = (FILE *) NULL;
char *pz_cmp = pz_data;
}
fclose (in_fp);
}
- close (fdp.read_fd); /* probably redundant, but I'm paranoid */
+ close (read_fd); /* probably redundant, but I'm paranoid */
/* Wait for child processes created by chain_open()
to avoid creating zombies. */