Likewise, replace 1 with `EXIT_FAILURE'.
(main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value.
+2004-05-08 Thien-Thi Nguyen <ttn@gnu.org>
+
+ * cvtmail.c: Throughout, replace 0 destined for `exit' arg
+ with `EXIT_SUCCESS'. Likewise, replace 1 with `EXIT_FAILURE'.
+ (main): Use `EXIT_SUCCESS' or `EXIT_FAILURE' for return value.
+
+ * ebrowse.c, emacsclient.c, fakemail.c, hexl.c,
+ make-docfile.c, movemail.c, profile.c, sorted-doc.c,
+ test-distrib.c, update-game-score.c, yow.c: Likewise.
+
2004-05-08 Thien-Thi Nguyen <ttn@gnu.org>
* Makefile.in (emacsclient${EXEEXT}): Use makefile var `version'.
}
fclose (mddf);
fclose (mfilef);
- return 0;
+ return EXIT_SUCCESS;
}
void
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
void
{
fprintf (stderr, "cvtmail: ");
perror (s);
- exit (1);
+ exit (EXIT_FAILURE);
}
char *
/* arch-tag: b93c25a9-9012-44f1-b78b-9cc7aed44a7a
(do not change this comment) */
+
+/* cvtmail.c ends here */
if (p == NULL)
{
yyerror ("out of memory", NULL);
- exit (1);
+ exit (EXIT_FAILURE);
}
return p;
}
if (p == NULL)
{
yyerror ("out of memory", NULL);
- exit (1);
+ exit (EXIT_FAILURE);
}
return p;
}
int error;
{
puts (USAGE);
- exit (error ? 1 : 0);
+ exit (error ? EXIT_FAILURE : EXIT_SUCCESS);
}
printf ("ebrowse %s\n", VERSION);
puts ("Copyright (C) 1992-1999, 2000, 2001 Free Software Foundation, Inc.");
puts ("This program is distributed under the same terms as Emacs.");
- exit (0);
+ exit (EXIT_SUCCESS);
}
if (yyout == NULL)
{
yyerror ("cannot open output file `%s'", out_filename);
- exit (1);
+ exit (EXIT_FAILURE);
}
}
if (yyout != stdout)
fclose (yyout);
- return 0;
+ return EXIT_SUCCESS;
}
-
-/* ebrowse.c ends here. */
-
/* arch-tag: fc03b4bc-91a9-4c3d-b3b9-12a77fa86dd8
(do not change this comment) */
+
+/* ebrowse.c ends here */
char *getenv (), *getwd ();
char *getcwd ();
-/* This is defined with -D from the compilation command,
- which extracts it from ../lisp/version.el. */
-
#ifndef VERSION
#define VERSION "unspecified"
#endif
case 'V':
printf ("emacsclient %s\n", VERSION);
- exit (0);
+ exit (EXIT_SUCCESS);
break;
case 'H':
default:
fprintf (stderr, "Try `%s --help' for more information\n", progname);
- exit (1);
+ exit (EXIT_FAILURE);
break;
}
}
Editor to fallback to if the server is not running\n\
\n\
Report bugs to bug-gnu-emacs@gnu.org.\n", progname);
- exit (0);
+ exit (EXIT_SUCCESS);
}
/* In NAME, insert a & before each &, each space, each newline, and
if (result == NULL)
{
perror ("malloc");
- exit (1);
+ exit (EXIT_FAILURE);
}
return result;
}
}
else
{
- exit (1);
+ exit (EXIT_FAILURE);
}
}
{
fprintf (stderr, "%s: file name or argument required\n", progname);
fprintf (stderr, "Try `%s --help' for more information\n", progname);
- exit (1);
+ exit (EXIT_FAILURE);
}
/*
{
fprintf (stderr, "%s: socket-name %s too long",
argv[0], socket_name);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* See if the socket exists, and if it's owned by us. */
{
fprintf (stderr, "%s: socket-name %s too long",
argv[0], socket_name);
- exit (1);
+ exit (EXIT_FAILURE);
}
sock_status = socket_status (server.sun_path);
}
fprintf (out, " ");
}
-
+
fprintf (out, "\n");
fflush (out);
/* Maybe wait for an answer. */
if (nowait)
- return 0;
+ return EXIT_SUCCESS;
if (!eval)
{
printf ("\n");
fflush (stdout);
- return 0;
+ return EXIT_SUCCESS;
}
#endif /* HAVE_SOCKETS */
/* arch-tag: f39bb9c4-73eb-477e-896d-50832e2ca9a7
(do not change this comment) */
+
+/* emacsclient.c ends here */
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Like malloc but get fatal error if memory is exhausted. */
no_problems = (no_problems &&
((*rem->action) (rem->handle) == 0));
the_streams = ((stream_list) NULL);
- return (no_problems ? 0 : 1);
+ return (no_problems ? EXIT_SUCCESS : EXIT_FAILURE);
}
void
if (next_line == ((line_list *) NULL))
{
/* Not a valid header */
- exit (1);
+ exit (EXIT_FAILURE);
}
*next_line = new_list ();
(*next_line)->string = alloc_string (length);
/* arch-tag: acb0afa6-315a-4c5b-b9e3-def5725c8783
(do not change this comment) */
+
+/* fakemail.c ends here */
fclose (fp);
} while (*argv != NULL);
- return 0;
+ return EXIT_SUCCESS;
}
void
usage ()
{
fprintf (stderr, "usage: %s [-de] [-iso]\n", progname);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* arch-tag: 20e04fb7-926e-4e48-be86-64fe869ecdaa
(do not change this comment) */
+
+/* hexl.c ends here */
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Like malloc but get fatal error if memory is exhausted. */
/* arch-tag: f7203aaf-991a-4238-acb5-601db56f2894
(do not change this comment) */
+
+/* make-docfile.c ends here */
preserve_mail++;
break;
default:
- exit(1);
+ exit (EXIT_FAILURE);
}
}
#else
fprintf (stderr, "Usage: movemail [-p] inbox destfile%s\n", "");
#endif
- exit (1);
+ exit (EXIT_FAILURE);
}
inname = argv[optind];
if (spool_name)
mailunlock ();
#endif
- exit (0);
+ exit (EXIT_SUCCESS);
}
wait (&status);
if (!WIFEXITED (status))
- exit (1);
+ exit (EXIT_FAILURE);
else if (WRETCODE (status) != 0)
exit (WRETCODE (status));
#endif /* ! DISABLE_DIRECT_ACCESS */
- return 0;
+ return EXIT_SUCCESS;
}
#ifdef MAIL_USE_MAILLOCK
if (delete_lockname)
unlink (delete_lockname);
error (s1, s2, 0);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Print error message. `s1' is printf control string, `s2' and `s3'
* If the mailbox is in the form "po:username:hostname", then it is
* modified by this function -- the second colon is replaced by a
* null.
+ *
+ * Return a value suitable for passing to `exit'.
*/
int
if (! server)
{
error ("Error connecting to POP server: %s", pop_error, 0);
- return (1);
+ return EXIT_FAILURE;
}
if (pop_stat (server, &nmsgs, &nbytes))
{
error ("Error getting message count from POP server: %s", pop_error, 0);
- return (1);
+ return EXIT_FAILURE;
}
if (!nmsgs)
{
pop_close (server);
- return (0);
+ return EXIT_SUCCESS;
}
mbfi = open (outfile, O_WRONLY | O_CREAT | O_EXCL, 0666);
{
pop_close (server);
error ("Error in open: %s, %s", strerror (errno), outfile);
- return (1);
+ return EXIT_FAILURE;
}
fchown (mbfi, getuid (), -1);
error ("Error in fdopen: %s", strerror (errno), 0);
close (mbfi);
unlink (outfile);
- return (1);
+ return EXIT_FAILURE;
}
if (reverse_order)
{
error (Errmsg, 0, 0);
close (mbfi);
- return (1);
+ return EXIT_FAILURE;
}
mbx_delimit_end (mbf);
fflush (mbf);
error ("Error in fflush: %s", strerror (errno), 0);
pop_close (server);
close (mbfi);
- return (1);
+ return EXIT_FAILURE;
}
}
if (fsync (mbfi) < 0)
{
error ("Error in fsync: %s", strerror (errno), 0);
- return (1);
+ return EXIT_FAILURE;
}
#endif
if (close (mbfi) == -1)
{
error ("Error in close: %s", strerror (errno), 0);
- return (1);
+ return EXIT_FAILURE;
}
if (! preserve)
{
error ("Error from POP server: %s", pop_error, 0);
pop_close (server);
- return (1);
+ return EXIT_FAILURE;
}
}
if (pop_quit (server))
{
error ("Error from POP server: %s", pop_error, 0);
- return (1);
+ return EXIT_FAILURE;
}
- return (0);
+ return EXIT_SUCCESS;
}
int
/* arch-tag: 1c323112-41fe-4fe5-8de9-494de631f73f
(do not change this comment) */
+
+/* movemail.c ends here */
get_time ()
{
if (watch_not_started)
- exit (1); /* call reset_watch first ! */
+ exit (EXIT_FAILURE); /* call reset_watch first ! */
EMACS_GET_TIME (TV2);
EMACS_SUB_TIME (TV2, TV2, TV1);
sprintf (time_string, "%lu.%06lu", (unsigned long)EMACS_SECS (TV2), (unsigned long)EMACS_USECS (TV2));
puts (get_time ());
break;
case 'q':
- exit (0);
+ exit (EXIT_SUCCESS);
}
/* Anything remaining on the line is ignored. */
while (c != '\n' && c != EOF)
c = getchar ();
}
- exit (1);
+ exit (EXIT_FAILURE);
}
/* arch-tag: 8db68f7e-2322-4944-a315-dba349bdbf39
(do not change this comment) */
+
+/* profile.c ends here */
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Like malloc but get fatal error if memory is exhausted. */
printf ("@bye\n");
}
- return 0;
+ return EXIT_SUCCESS;
}
/* arch-tag: ce28f204-1e70-4b34-8210-3d54a5662071
(do not change this comment) */
+
+/* sorted-doc.c ends here */
exit (2);
}
close (fd);
-#ifdef VMS
- exit (1); /* On VMS, success is 1. */
-#endif
- return (0);
+ return EXIT_SUCCESS;
}
/* arch-tag: 3a89005d-df98-4c32-aa9f-33570e16a26a
(do not change this comment) */
+
+/* test-distrib.c ends here */
const char *msg;
{
fprintf (stderr, "%s\n", msg);
- exit (1);
+ exit (EXIT_FAILURE);
}
void lose_syserr P_ ((const char *msg)) NO_RETURN;
const char *msg;
{
fprintf (stderr, "%s: %s\n", msg, strerror (errno));
- exit (1);
+ exit (EXIT_FAILURE);
}
char *
switch (c)
{
case 'h':
- usage (0);
+ usage (EXIT_SUCCESS);
break;
case 'd':
user_prefix = optarg;
max = MAX_SCORES;
break;
default:
- usage (1);
+ usage (EXIT_FAILURE);
}
if (optind+3 != argc)
- usage (1);
+ usage (EXIT_FAILURE);
running_suid = (getuid () != geteuid ());
lose_syserr ("Failed to write scores file");
}
unlock_file (scorefile, lockstate);
- exit (0);
+ exit (EXIT_SUCCESS);
}
int
/* arch-tag: 2bf5c52e-4beb-463a-954e-c58b9c64736b
(do not change this comment) */
+
+/* update-game-score.c ends here */
if ((fp = fopen(file, "r")) == NULL) {
fprintf(stderr, "yow: ");
perror(file);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* initialize random seed */
setup_yow(fp);
yow(fp);
fclose(fp);
- return 0;
+ return EXIT_SUCCESS;
}
static long len = -1;
if (fseek(fp, 0L, 2) == -1) {
perror("yow");
- exit(1);
+ exit(EXIT_FAILURE);
}
len = ftell(fp) - header_len;
}
offset = rand() % len + header_len;
if (fseek(fp, offset, 0) == -1) {
perror("yow");
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Read until SEP, read next line, print it.
/* arch-tag: e40fc0df-bafb-4001-af24-5c883d1c685e
(do not change this comment) */
+
+/* yow.c ends here */