Article View: gnu.emacs.bug
Article #9998918.55 etc/emacsclient.c -- unnecessary abort()
From: Jonathan I. Kamens
Date: Mon, 19 Feb 1990 07:59
Date: Mon, 19 Feb 1990 07:59
61 lines
2409 bytes
2409 bytes
etc/emacsclient.c in emacs v. 18.55 calls abort() if it can't get
the current working directory. This is a bit extreme, since any
number of situations may cause this problem (and I don't think
anything of them are drastic enough to require an abort()).
The following patch implements (for the bsd half of the program, at
least) behavior that is a bit better. Note that I've tested this
under 4.3bsd, but I haven't tested it under 4.2 or 4.1 -- I don't know
if errno, sys_nerr or sys_errlist are defined in errno.h (or if they
even exist -- I'm pretty sure errno does, but I'm not sure about the
others) under 4.2 or 4.1.
Jonathan Kamens USnail:
MIT Project Athena 11 Ashford Terrace
jik@Athena.MIT.EDU Allston, MA 02134
Office: 617-253-8495 Home: 617-782-0710
*** /tmp/,RCSt1018669 Mon Feb 19 02:59:14 1990
--- emacsclient.c Mon Feb 19 02:57:32 1990
***************
*** 47,53 ****
#include <sys/socket.h>
#include <sys/un.h>
#include <stdio.h>
!
main (argc, argv)
int argc;
char **argv;
--- 47,54 ----
#include <sys/socket.h>
#include <sys/un.h>
#include <stdio.h>
! #include <errno.h>
!
main (argc, argv)
int argc;
char **argv;
***************
*** 96,102 ****
cwd = getwd (string);
if (cwd == 0)
! abort ();
for (i = 1; i < argc; i++)
{
--- 97,109 ----
cwd = getwd (string);
if (cwd == 0)
! {
! /* getwd() puts an error message in the buffer passed to it if */
! /* there if an error. */
! fprintf (stderr, "%s: %s (%s)\n", argv[0], string,
! (errno < sys_nerr) ? sys_errlist[errno] : "unknown error");
! exit (1);
! }
for (i = 1; i < argc; i++)
{
Technical Details
Message-ID:
<9002190759.AA18674@pit-manager.MIT.EDU>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!PIT-MANAGER.MIT.EDU!jikShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,9858c37b5290facc,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-02-19 10:02:24 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!PIT-MANAGER.MIT.EDU!jik From: jik@PIT-MANAGER.MIT.EDU (Jonathan I. Kamens) Newsgroups: gnu.emacs.bug Subject: 18.55 etc/emacsclient.c -- unnecessary abort() Message-ID: <9002190759.AA18674@pit-manager.MIT.EDU> Date: 19 Feb 90 07:59:54 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 61 Posted: Mon Feb 19 08:59:54 1990