delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/11/08/07:56:11

Date: Sun, 8 Nov 1998 14:54:43 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: djgpp-workers AT delorie DOT com
Subject: Minor bugfix for error messages in redir
Message-ID: <Pine.SUN.3.91.981108145328.13039H-100000@is>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com

This patch makes error messages from redir to look nicer, especially when 
several are printed in a row:

*** src/utils/redir.c~0	Sun Jul 26 13:34:04 1998
--- src/utils/redir.c	Fri Nov  6 19:17:30 1998
*************** static void
*** 89,95 ****
  fatal(const char *msg, const char *fn)
  {
    fprintf(std_err, msg, fn);
!   fprintf(std_err, "The error was: %s\n", strerror(errno));
    exit(1);
  }
  
--- 89,95 ----
  fatal(const char *msg, const char *fn)
  {
    fprintf(std_err, msg, fn);
!   fprintf(std_err, "\nThe error was: %s\n", strerror(errno));
    exit(1);
  }
  
*************** main(int argc, char **argv)
*** 305,311 ****
    if (argc <= 1)
    {
      errno = EINVAL;
!     fatal("Missing program name; aborting\n", "");
    }
  
    /* We do NOT want `redir' to abort if the child is interrupted
--- 305,311 ----
    if (argc <= 1)
    {
      errno = EINVAL;
!     fatal("Missing program name; aborting", "");
    }
  
    /* We do NOT want `redir' to abort if the child is interrupted
*************** main(int argc, char **argv)
*** 319,325 ****
    __djgpp_exception_toggle();
  
    if (rv < 0)
!     fatal("Error attempting to run program %s\n", argv[1]);
  
    if (display_exit_code)
    {
--- 319,325 ----
    __djgpp_exception_toggle();
  
    if (rv < 0)
!     fatal("Error attempting to run program %s", argv[1]);
  
    if (display_exit_code)
    {

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019