source: trunk/athena/bin/newpag/newpag.c @ 9523

Revision 9523, 1.1 KB checked in by ghudson, 28 years ago (diff)
Conform to the Athena codnig standards.
Line 
1/* Copyright 1996 by the Massachusetts Institute of Technology.
2 *
3 * Permission to use, copy, modify, and distribute this
4 * software and its documentation for any purpose and without
5 * fee is hereby granted, provided that the above copyright
6 * notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting
8 * documentation, and that the name of M.I.T. not be used in
9 * advertising or publicity pertaining to distribution of the
10 * software without specific, written prior permission.
11 * M.I.T. makes no representations about the suitability of
12 * this software for any purpose.  It is provided "as is"
13 * without express or implied warranty.
14 */
15
16static const char rcsid[] = "$Id: newpag.c,v 1.4 1997-01-11 19:24:00 ghudson Exp $";
17
18#include <stdio.h>
19#include <stdlib.h>
20#include <unistd.h>
21
22int main(int argc, char **argv)
23{
24  char *shell;
25  int code;
26
27  code = setpag();
28  if (code != 0)
29    {
30      perror("setpag");
31      exit(1);
32    }
33
34  shell = getenv("SHELL");
35  if (argc == 1)
36    execl(shell != NULL ? shell : "/bin/sh", "sh", 0);
37  else
38    execvp(argv[1], argv + 1);
39  exit(1);
40}
Note: See TracBrowser for help on using the repository browser.