Branch: Tag:

2006-10-19

2006-10-19 15:30:46 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Backported some diagnostics from Pike 7.7.

Rev: lib/master.pike.in:1.358

6:   // Pike is distributed under GPL, LGPL and MPL. See the file COPYING   // for more information.   // - // $Id: master.pike.in,v 1.357 2006/02/20 11:44:10 nilsson Exp $ + // $Id: master.pike.in,v 1.358 2006/10/19 15:30:46 grubba Exp $      #pike __REAL_VERSION__   //#pragma strict_types
2652:    prog=(program)argv[0];    };    -  if (err) +  if (err) { +  if( !file_stat(argv[0]) ) { +  werror("Could not find file %O. %s.\n", argv[0], strerror(errno())); +  exit(1); +  } +  if( !file_stat(argv[0])->isreg ) { +  werror("File %O is not a regular file.\n", argv[0]); +  exit(1); +  } +  if( !master_read_file(argv[0]) ) { +  werror("File %O is not readable. %s.\n", argv[0], strerror(errno())); +  exit(1); +  }    error( "Pike: Failed to compile script:\n"    "%s\n", stringp(err[0])?err[0]:describe_backtrace(err) );    } -  +  }       if(!prog)    error("Pike: Couldn't find script to execute\n(%O)\n", argv[0]);