Subject: Re: [GRASS5] compiling beta10 on IRIX and CYGWIN/WIN32

Justin Hickey jhickey at hpcc.nectec.or.th
Mon Dec 18 03:55:38 EST 2000


Ooops! I forgot to attach run.c. Here it is.

-- 
Sincerely,

Jazzman (a.k.a. Justin Hickey)  e-mail: jhickey at hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do.  ---Anonymous

Jazz and Trek Rule!!!
==================================================================
-------------- next part --------------
/****************************************************************
this program runs its arguments as  a  commmand.  it  essentially
does what the sh would do to look for the command. if / occurs in
the command it runs it  as  is,  otherwise  it  search  the  PATH
variable.  care  is  taken  to preserve the PATH variable that is
passed (as part of the environment) to the command being invoked.

the signals SIGINT and SIGQUIT are  set  to  the  default  action
before running the command.

This  program  is  needed  because  the  GIS  shell  must  ignore
interrupts when it runs the user's shell. There is no way to tell
the user's shell to re-activate interrupts in shell-ese.
****************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <unistd.h>
#include "local_proto.h"

int main (int argc, char *argv[])
{
    char *PATH;
    char path[1024];
    char *a,*b,*c;
    int more;

    signal (SIGINT, SIG_DFL);
    signal (SIGQUIT, SIG_DFL);

    argc--;
    argv++;
    if (argc <= 0) exit(1);

    execvp (argv[0],argv);
    fprintf (stderr, "%s: Command not found\n",argv[0]);
    exit(127);

    exit(0);
}


More information about the grass-dev mailing list