summaryrefslogtreecommitdiff
path: root/lib-src
diff options
context:
space:
mode:
authorKaroly Lorentey <lorentey@elte.hu>2004-05-11 09:11:36 +0000
committerKaroly Lorentey <lorentey@elte.hu>2004-05-11 09:11:36 +0000
commit08a4c2dc40347474520f97dc002da31b84c3afe4 (patch)
tree1a24c347f23eaf03f491e0b6c21fd41b0bb63393 /lib-src
parentaa4dd97142c60238568c9824d8282e755e906385 (diff)
parent557565f7751f5034378a4641aa8c3bf6f21912e3 (diff)
downloademacs-08a4c2dc40347474520f97dc002da31b84c3afe4.tar.gz
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-290 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-161
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog14
-rw-r--r--lib-src/Makefile.in4
-rw-r--r--lib-src/cvtmail.c8
-rw-r--r--lib-src/ebrowse.c17
-rw-r--r--lib-src/emacsclient.c27
-rw-r--r--lib-src/fakemail.c8
-rw-r--r--lib-src/hexl.c6
-rw-r--r--lib-src/make-docfile.c4
-rw-r--r--lib-src/movemail.c40
-rw-r--r--lib-src/profile.c8
-rw-r--r--lib-src/sorted-doc.c6
-rw-r--r--lib-src/test-distrib.c7
-rw-r--r--lib-src/update-game-score.c14
-rw-r--r--lib-src/yow.c10
14 files changed, 101 insertions, 72 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index 75d5f964201..8c641f45ae7 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,17 @@
+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'.
+
2004-05-07 Thien-Thi Nguyen <ttn@gnu.org>
* b2m.c (GOOD, BAD): Delete macros. Throughout,
diff --git a/lib-src/Makefile.in b/lib-src/Makefile.in
index 7868364148a..1da04d88b82 100644
--- a/lib-src/Makefile.in
+++ b/lib-src/Makefile.in
@@ -1,5 +1,5 @@
# Makefile for lib-src subdirectory in GNU Emacs.
-# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003
+# Copyright (C) 1985, 1987, 1988, 1993, 1994, 2002, 2003, 2004
# Free Software Foundation, Inc.
# This file is part of GNU Emacs.
@@ -447,7 +447,7 @@ yow${EXEEXT}: ${srcdir}/yow.c ../src/epaths.h
emacsclient${EXEEXT}: ${srcdir}/emacsclient.c ../src/config.h $(GETOPTDEPS)
$(CC) ${ALL_CFLAGS} ${srcdir}/emacsclient.c $(GETOPTOBJS) \
- -DVERSION=`sed -n -e '/(defconst emacs-version/ s/^[^"]*\("[^"]*"\).*/\1/p' ${srcdir}/../lisp/version.el` \
+ -DVERSION="\"${version}\"" \
$(LOADLIBES) -o emacsclient
hexl${EXEEXT}: ${srcdir}/hexl.c ../src/config.h
diff --git a/lib-src/cvtmail.c b/lib-src/cvtmail.c
index 28a4ae4c703..8992b3f9e80 100644
--- a/lib-src/cvtmail.c
+++ b/lib-src/cvtmail.c
@@ -119,7 +119,7 @@ main (argc, argv)
}
fclose (mddf);
fclose (mfilef);
- return 0;
+ return EXIT_SUCCESS;
}
void
@@ -148,7 +148,7 @@ fatal (s1, s2)
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
void
@@ -157,7 +157,7 @@ sysfail (s)
{
fprintf (stderr, "cvtmail: ");
perror (s);
- exit (1);
+ exit (EXIT_FAILURE);
}
char *
@@ -183,3 +183,5 @@ xrealloc (ptr, size)
/* arch-tag: b93c25a9-9012-44f1-b78b-9cc7aed44a7a
(do not change this comment) */
+
+/* cvtmail.c ends here */
diff --git a/lib-src/ebrowse.c b/lib-src/ebrowse.c
index eeeb0eb3efd..4ad45d195f6 100644
--- a/lib-src/ebrowse.c
+++ b/lib-src/ebrowse.c
@@ -564,7 +564,7 @@ xmalloc (nbytes)
if (p == NULL)
{
yyerror ("out of memory", NULL);
- exit (1);
+ exit (EXIT_FAILURE);
}
return p;
}
@@ -581,7 +581,7 @@ xrealloc (p, sz)
if (p == NULL)
{
yyerror ("out of memory", NULL);
- exit (1);
+ exit (EXIT_FAILURE);
}
return p;
}
@@ -3671,7 +3671,7 @@ usage (error)
int error;
{
puts (USAGE);
- exit (error ? 1 : 0);
+ exit (error ? EXIT_FAILURE : EXIT_SUCCESS);
}
@@ -3688,7 +3688,7 @@ version ()
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);
}
@@ -3925,7 +3925,7 @@ main (argc, argv)
if (yyout == NULL)
{
yyerror ("cannot open output file `%s'", out_filename);
- exit (1);
+ exit (EXIT_FAILURE);
}
}
@@ -3970,11 +3970,10 @@ main (argc, argv)
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 */
diff --git a/lib-src/emacsclient.c b/lib-src/emacsclient.c
index 92f19d4746c..a241a17eb60 100644
--- a/lib-src/emacsclient.c
+++ b/lib-src/emacsclient.c
@@ -48,9 +48,6 @@ Boston, MA 02111-1307, USA. */
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
@@ -157,7 +154,7 @@ decode_options (argc, argv)
case 'V':
printf ("emacsclient %s\n", VERSION);
- exit (0);
+ exit (EXIT_SUCCESS);
break;
case 't':
@@ -176,7 +173,7 @@ decode_options (argc, argv)
default:
fprintf (stderr, "Try `%s --help' for more information\n", progname);
- exit (1);
+ exit (EXIT_FAILURE);
break;
}
}
@@ -209,7 +206,7 @@ The following OPTIONS are accepted:\n\
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);
}
/* Like malloc but get fatal error if memory is exhausted. */
@@ -222,7 +219,7 @@ xmalloc (size)
if (result == NULL)
{
perror ("malloc");
- exit (1);
+ exit (EXIT_FAILURE);
}
return result;
}
@@ -236,7 +233,7 @@ xstrdup (const char *s)
if (result == NULL)
{
perror ("strdup");
- exit (1);
+ exit (EXIT_FAILURE);
}
return result;
}
@@ -336,7 +333,7 @@ fail (void)
}
else
{
- exit (1);
+ exit (EXIT_FAILURE);
}
}
@@ -520,7 +517,7 @@ main (argc, argv)
{
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);
}
/*
@@ -598,7 +595,7 @@ main (argc, argv)
{
fprintf (stderr, "%s: socket-name %s too long",
argv[0], socket_name);
- exit (1);
+ exit (EXIT_FAILURE);
}
sock_status = socket_status (server.sun_path);
@@ -819,9 +816,7 @@ To start the server in Emacs, type \"M-x server-start\".\n",
/* Maybe wait for an answer. */
if (nowait)
- {
- return 0;
- }
+ return EXIT_SUCCESS;
if (!eval && !tty)
{
@@ -883,7 +878,7 @@ To start the server in Emacs, type \"M-x server-start\".\n",
fflush (stdout);
fsync (1);
- return 0;
+ return EXIT_SUCCESS;
}
#endif /* HAVE_SOCKETS */
@@ -905,3 +900,5 @@ strerror (errnum)
/* arch-tag: f39bb9c4-73eb-477e-896d-50832e2ca9a7
(do not change this comment) */
+
+/* emacsclient.c ends here */
diff --git a/lib-src/fakemail.c b/lib-src/fakemail.c
index 944a728a28c..cee7eaa130e 100644
--- a/lib-src/fakemail.c
+++ b/lib-src/fakemail.c
@@ -169,7 +169,7 @@ fatal (s1, s2)
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Like malloc but get fatal error if memory is exhausted. */
@@ -410,7 +410,7 @@ close_the_streams ()
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
@@ -667,7 +667,7 @@ read_header ()
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);
@@ -753,3 +753,5 @@ main (argc, argv)
/* arch-tag: acb0afa6-315a-4c5b-b9e3-def5725c8783
(do not change this comment) */
+
+/* fakemail.c ends here */
diff --git a/lib-src/hexl.c b/lib-src/hexl.c
index 0cfb88445b3..5ca7c2a5b8a 100644
--- a/lib-src/hexl.c
+++ b/lib-src/hexl.c
@@ -270,15 +270,17 @@ main (argc, argv)
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 */
diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c
index 1c0bc559225..802b4e09e67 100644
--- a/lib-src/make-docfile.c
+++ b/lib-src/make-docfile.c
@@ -104,7 +104,7 @@ fatal (s1, s2)
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Like malloc but get fatal error if memory is exhausted. */
@@ -1210,3 +1210,5 @@ scan_lisp_file (filename, mode)
/* arch-tag: f7203aaf-991a-4238-acb5-601db56f2894
(do not change this comment) */
+
+/* make-docfile.c ends here */
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 2d0cd9043fd..a634e2966d7 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -216,7 +216,7 @@ main (argc, argv)
preserve_mail++;
break;
default:
- exit(1);
+ exit (EXIT_FAILURE);
}
}
@@ -234,7 +234,7 @@ main (argc, argv)
#else
fprintf (stderr, "Usage: movemail [-p] inbox destfile%s\n", "");
#endif
- exit (1);
+ exit (EXIT_FAILURE);
}
inname = argv[optind];
@@ -536,12 +536,12 @@ main (argc, argv)
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));
@@ -554,7 +554,7 @@ main (argc, argv)
#endif /* ! DISABLE_DIRECT_ACCESS */
- return 0;
+ return EXIT_SUCCESS;
}
#ifdef MAIL_USE_MAILLOCK
@@ -607,7 +607,7 @@ fatal (s1, s2)
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'
@@ -709,6 +709,8 @@ char Errmsg[200]; /* POP errors, at least, can exceed
* 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
@@ -736,19 +738,19 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
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);
@@ -756,7 +758,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
{
pop_close (server);
error ("Error in open: %s, %s", strerror (errno), outfile);
- return (1);
+ return EXIT_FAILURE;
}
fchown (mbfi, getuid (), -1);
@@ -766,7 +768,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
error ("Error in fdopen: %s", strerror (errno), 0);
close (mbfi);
unlink (outfile);
- return (1);
+ return EXIT_FAILURE;
}
if (reverse_order)
@@ -789,7 +791,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
{
error (Errmsg, 0, 0);
close (mbfi);
- return (1);
+ return EXIT_FAILURE;
}
mbx_delimit_end (mbf);
fflush (mbf);
@@ -798,7 +800,7 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
error ("Error in fflush: %s", strerror (errno), 0);
pop_close (server);
close (mbfi);
- return (1);
+ return EXIT_FAILURE;
}
}
@@ -812,14 +814,14 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
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)
@@ -829,17 +831,17 @@ popmail (mailbox, outfile, preserve, password, reverse_order)
{
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
@@ -957,3 +959,5 @@ strerror (errnum)
/* arch-tag: 1c323112-41fe-4fe5-8de9-494de631f73f
(do not change this comment) */
+
+/* movemail.c ends here */
diff --git a/lib-src/profile.c b/lib-src/profile.c
index ec77936f74d..8d924532b87 100644
--- a/lib-src/profile.c
+++ b/lib-src/profile.c
@@ -55,7 +55,7 @@ char *
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));
@@ -94,14 +94,16 @@ main ()
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 */
diff --git a/lib-src/sorted-doc.c b/lib-src/sorted-doc.c
index 05a3e69cc92..3af3276e811 100644
--- a/lib-src/sorted-doc.c
+++ b/lib-src/sorted-doc.c
@@ -75,7 +75,7 @@ fatal (s1, s2)
char *s1, *s2;
{
error (s1, s2);
- exit (1);
+ exit (EXIT_FAILURE);
}
/* Like malloc but get fatal error if memory is exhausted. */
@@ -279,8 +279,10 @@ main ()
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 */
diff --git a/lib-src/test-distrib.c b/lib-src/test-distrib.c
index f7b3a8b8004..97e87695c7c 100644
--- a/lib-src/test-distrib.c
+++ b/lib-src/test-distrib.c
@@ -100,11 +100,10 @@ have been corrupted in the files of Emacs, and it will not work.\n",
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 */
diff --git a/lib-src/update-game-score.c b/lib-src/update-game-score.c
index 74fa2b06920..8f7c90cad55 100644
--- a/lib-src/update-game-score.c
+++ b/lib-src/update-game-score.c
@@ -111,7 +111,7 @@ lose (msg)
const char *msg;
{
fprintf (stderr, "%s\n", msg);
- exit (1);
+ exit (EXIT_FAILURE);
}
void lose_syserr P_ ((const char *msg)) NO_RETURN;
@@ -138,7 +138,7 @@ lose_syserr (msg)
const char *msg;
{
fprintf (stderr, "%s: %s\n", msg, strerror (errno));
- exit (1);
+ exit (EXIT_FAILURE);
}
char *
@@ -199,7 +199,7 @@ main (argc, argv)
switch (c)
{
case 'h':
- usage (0);
+ usage (EXIT_SUCCESS);
break;
case 'd':
user_prefix = optarg;
@@ -213,11 +213,11 @@ main (argc, argv)
max = MAX_SCORES;
break;
default:
- usage (1);
+ usage (EXIT_FAILURE);
}
if (optind+3 != argc)
- usage (1);
+ usage (EXIT_FAILURE);
running_suid = (getuid () != geteuid ());
@@ -266,7 +266,7 @@ main (argc, argv)
lose_syserr ("Failed to write scores file");
}
unlock_file (scorefile, lockstate);
- exit (0);
+ exit (EXIT_SUCCESS);
}
int
@@ -531,3 +531,5 @@ unlock_file (filename, state)
/* arch-tag: 2bf5c52e-4beb-463a-954e-c58b9c64736b
(do not change this comment) */
+
+/* update-game-score.c ends here */
diff --git a/lib-src/yow.c b/lib-src/yow.c
index 10f0fad1ce7..9d58ce5aecb 100644
--- a/lib-src/yow.c
+++ b/lib-src/yow.c
@@ -73,7 +73,7 @@ main (argc, argv)
if ((fp = fopen(file, "r")) == NULL) {
fprintf(stderr, "yow: ");
perror(file);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* initialize random seed */
@@ -82,7 +82,7 @@ main (argc, argv)
setup_yow(fp);
yow(fp);
fclose(fp);
- return 0;
+ return EXIT_SUCCESS;
}
static long len = -1;
@@ -113,7 +113,7 @@ setup_yow(fp)
if (fseek(fp, 0L, 2) == -1) {
perror("yow");
- exit(1);
+ exit(EXIT_FAILURE);
}
len = ftell(fp) - header_len;
}
@@ -132,7 +132,7 @@ yow (fp)
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.
@@ -180,3 +180,5 @@ yow (fp)
/* arch-tag: e40fc0df-bafb-4001-af24-5c883d1c685e
(do not change this comment) */
+
+/* yow.c ends here */