/* Protoize program - Original version by Ron Guilmette (rfg@segfault.us.com).
- Copyright (C) 1989, 92-95, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1989, 92-96, 1997 Free Software Foundation, Inc.
This file is part of GNU CC.
extern int puts ();
extern int fputs ();
extern int fputc ();
+#if !defined(_WIN32)
extern int link ();
+#endif
extern int unlink ();
extern int access ();
if (rv == NULL)
{
fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);
- exit (1);
+ exit (FATAL_EXIT_CODE);
return 0; /* avoid warnings */
}
else
if (rv == NULL)
{
fprintf (stderr, "\n%s: virtual memory exceeded\n", pname);
- exit (1);
+ exit (FATAL_EXIT_CODE);
return 0; /* avoid warnings */
}
else
fancy_abort ()
{
fprintf (stderr, "%s: internal abort\n", pname);
- exit (1);
+ exit (FATAL_EXIT_CODE);
}
\f
/* Make a duplicate of the first N bytes of a given string in a newly
fprintf (stderr, "%s: usage '%s [ -VqfnkNlgC ] [ -B <dirname> ] [ filename ... ]'\n",
pname, pname);
#endif /* !defined (UNPROTOIZE) */
- exit (1);
+ exit (FATAL_EXIT_CODE);
}
/* Return true if the given filename (assumed to be an absolute filename)
while (outp >= abs_buffer && *outp != '/')
outp--;
if (outp < abs_buffer)
- {
- /* Catch cases like /.. where we try to backup to a
- point above the absolute root of the logical file
- system. */
-
- fprintf (stderr, "%s: invalid file name: %s\n",
- pname, rel_filename);
- exit (1);
- }
+ {
+ /* Catch cases like /.. where we try to backup to a
+ point above the absolute root of the logical file
+ system. */
+
+ fprintf (stderr, "%s: invalid file name: %s\n",
+ pname, rel_filename);
+ exit (FATAL_EXIT_CODE);
+ }
*++outp = '\0';
continue;
- }
+ }
}
*outp++ = *inp++;
}
{
fprintf (stderr, "\n%s: fatal error: aux info file corrupted at line %d\n",
pname, current_aux_info_lineno);
- exit (1);
+ exit (FATAL_EXIT_CODE);
}
/* ??? This comment is vague. Say what the condition is for. */
const char *left_paren_p = find_corresponding_lparen (p);
#ifndef UNPROTOIZE
{
- f_list_chain_item *cip =
- (f_list_chain_item *) xmalloc (sizeof (f_list_chain_item));
+ f_list_chain_item *cip
+ = (f_list_chain_item *) xmalloc (sizeof (f_list_chain_item));
cip->formals_list
= dupnstr (left_paren_p + 1, (size_t) (p - (left_paren_p+1)));
def_dec_p->file->hash_entry->symbol,
def_dec_p->line,
def_dec_p->hash_entry->symbol);
- exit (1);
+ exit (FATAL_EXIT_CODE);
}
free_def_dec (def_dec_p);
return;
if (!nosave_flag)
{
- char *new_filename =
- (char *) xmalloc (strlen (convert_filename) + strlen (save_suffix) + 2);
+ char *new_filename
+ = (char *) xmalloc (strlen (convert_filename) + strlen (save_suffix) + 2);
strcpy (new_filename, convert_filename);
strcat (new_filename, save_suffix);
{
fprintf (stderr, "%s: cannot get working directory: %s\n",
pname, my_strerror(errno));
- exit (1);
+ exit (FATAL_EXIT_CODE);
}
/* By default, convert the files in the current directory. */
/* Now actually make a list of the base source filenames. */
- base_source_filenames =
- (const char **) xmalloc ((n_base_source_files + 1) * sizeof (char *));
+ base_source_filenames
+ = (const char **) xmalloc ((n_base_source_files + 1) * sizeof (char *));
n_base_source_files = 0;
for (; optind < argc; optind++)
{
fprintf (stderr, "%s: %s\n", pname, version_string);
do_processing ();
}
- if (errors)
- exit (1);
- else
- exit (0);
+
+ exit (errors ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
+
return 1;
}