/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 1985 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* under.c - program to execute a command under a given directory
*
*/
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int Debug = 0;
/*
* SETPROCTITLE -- set the title of this process for "ps"
*
* Does nothing if there were not enough arguments on the command
* line for the information.
*
* Side Effects:
* Clobbers argv[] of our main procedure.
*/
void
{
register char *tohere;
return;
while (*tohere++) /* Skip to end of printf output */
;
*tohere++ = ' ';
}
void
int argc;
char **argv;
{
char *dir, *p;
int status;
int len;
if (argc < 3)
{
exit(1);
}
/*
* argv start and extent for setproctitle()
*/
if (argc > 0)
else
{
Debug = 1;
argv++;
}
{
if (p[1] != '/')
{
exit(1);
}
{
printf("mktemp of %s returned %d %s\n",
}
errno = 0; /* XXX access() call in mktemp sets errno = ENOENT */
{
exit(1);
}
printf("mkdir of %s returned %d %s\n",
{
exit(1);
}
{
exit(1);
}
}
{
exit(1);
}
exit(1);
/* NOTREACHED */
}
typedef void (*sig_t)();
int
char *dir;
char *cmd;
char **args;
{
if (pid == -1)
return (0177);
if (pid == 0)
{
{
exit(1);
}
exit(1);
}
;
if (child == -1)
return (0177);
if (status & 0377)
return (status & 0377);
}