Remove apollo support
This commit is contained in:
@@ -258,25 +258,7 @@ int b_hist __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra))
|
||||
arg = edit;
|
||||
if(!arg && !(arg=nv_getval(nv_scoped(HISTEDIT))) && !(arg=nv_getval(nv_scoped(FCEDNOD))))
|
||||
arg = (char*)e_defedit;
|
||||
#ifdef apollo
|
||||
/*
|
||||
* Code to support the FC using the pad editor.
|
||||
* Exampled of how to use: HISTEDIT=pad
|
||||
*/
|
||||
if (strcmp (arg, "pad") == 0)
|
||||
{
|
||||
extern __MANGLE__ int pad_create __PROTO__((char*));
|
||||
sh_close(fdo);
|
||||
fdo = pad_create(fname);
|
||||
pad_wait(fdo);
|
||||
unlink(fname);
|
||||
strcat(fname, ".bak");
|
||||
unlink(fname);
|
||||
lseek(fdo,(off_t)0,SEEK_SET);
|
||||
}
|
||||
else
|
||||
{
|
||||
#endif /* apollo */
|
||||
|
||||
if(*arg != '-')
|
||||
{
|
||||
char *com[3];
|
||||
@@ -288,9 +270,7 @@ int b_hist __PARAM__((int argc,char *argv[], __V_ *extra), (argc, argv, extra))
|
||||
fdo = sh_chkopen(fname);
|
||||
unlink(fname);
|
||||
free((__V_*)fname);
|
||||
#ifdef apollo
|
||||
}
|
||||
#endif /* apollo */
|
||||
|
||||
/* don't history fc itself unless forked */
|
||||
error_info.flags |= ERROR_SILENT;
|
||||
if(!sh_isstate(SH_FORKED))
|
||||
|
||||
@@ -767,15 +767,7 @@ static int b_unall __PARAM__((int argc, char **argv, register Hashtab_t *troot),
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#ifdef apollo
|
||||
else
|
||||
{
|
||||
short namlen;
|
||||
name = nv_name(np);
|
||||
namlen =strlen(name);
|
||||
ev_$delete_var(name,&namlen);
|
||||
}
|
||||
#endif /* apollo */
|
||||
|
||||
if(sh.subshell)
|
||||
np=sh_assignok(np,0);
|
||||
nv_unset(np);
|
||||
|
||||
@@ -183,11 +183,6 @@ const struct shtable3 shtab_builtins[] =
|
||||
"wait", NV_BLTIN|BLT_ENV|BLT_EXIT, bltin(wait),
|
||||
"type", NV_BLTIN|BLT_ENV, bltin(whence),
|
||||
"whence", NV_BLTIN|BLT_ENV, bltin(whence),
|
||||
#ifdef apollo
|
||||
"inlib", NV_BLTIN|BLT_ENV, bltin(inlib),
|
||||
"rootnode", NV_BLTIN, bltin(rootnode),
|
||||
"ver", NV_BLTIN, bltin(ver),
|
||||
#endif /* apollo */
|
||||
"/bin/basename",NV_BLTIN|NV_NOFREE, bltin(basename),
|
||||
"/bin/chmod", NV_BLTIN|NV_NOFREE, bltin(chmod),
|
||||
"/bin/dirname", NV_BLTIN|NV_NOFREE, bltin(dirname),
|
||||
|
||||
@@ -213,11 +213,6 @@ const char e_alphanum[] = "[_[:alpha:]]*([_[:alnum:]])";
|
||||
const char e_vpixdir[] = "/usr/bin";
|
||||
#endif /* SHOPT_VPIX */
|
||||
const char e_devfdNN[] = "/dev/fd/+([0-9])";
|
||||
#ifdef apollo
|
||||
const char e_rootnode[] = "Bad root node specification";
|
||||
const char e_nover[] = "Version not defined";
|
||||
const char e_badver[] = "Unrecognized version";
|
||||
#endif /* apollo */
|
||||
#ifdef SHOPT_FS_3D
|
||||
const char e_cantget[] = "cannot get %s";
|
||||
const char e_cantset[] = "cannot set %s";
|
||||
|
||||
@@ -119,9 +119,6 @@ static struct shtable2 _shtab_signals[] =
|
||||
#ifdef SIGALRM
|
||||
"ALRM", VAL(SIGALRM,SH_SIGFAULT), "Alarm call",
|
||||
#endif /* SIGALRM */
|
||||
#ifdef SIGAPOLLO
|
||||
"APOLLO", VAL(SIGAPOLLO,0), "SIGAPOLLO",
|
||||
#endif /* SIGAPOLLO */
|
||||
#ifdef SIGBUS
|
||||
"BUS", VAL(SIGBUS,SH_SIGDONE), "Bus error",
|
||||
#endif /* SIGBUS */
|
||||
|
||||
@@ -168,9 +168,6 @@ const struct shtable2 shtab_variables[] =
|
||||
#ifdef SHOPT_MULTIBYTE
|
||||
"CSWIDTH", 0, (char*)0,
|
||||
#endif /* SHOPT_MULTIBYTE */
|
||||
#ifdef apollo
|
||||
"SYSTYPE", 0, (char*)0,
|
||||
#endif /* apollo */
|
||||
"", 0, (char*)0
|
||||
};
|
||||
|
||||
|
||||
@@ -185,13 +185,6 @@ extern __MANGLE__ int b_tty __PROTO__((int, char*[],__V_*));
|
||||
extern __MANGLE__ int b_uname __PROTO__((int, char*[],__V_*));
|
||||
extern __MANGLE__ int b_wc __PROTO__((int, char*[],__V_*));
|
||||
|
||||
/* The following are extensions for apollo computers */
|
||||
#ifdef apollo
|
||||
extern __MANGLE__ int b_rootnode __PROTO__((int, char*[],__V_*));
|
||||
extern __MANGLE__ int b_inlib __PROTO__((int, char*[],__V_*));
|
||||
extern __MANGLE__ int b_ver __PROTO__((int, char*[],__V_*));
|
||||
#endif /* apollo */
|
||||
|
||||
extern __MANGLE__ const char e_alrm1[];
|
||||
extern __MANGLE__ const char e_alrm2[];
|
||||
extern __MANGLE__ const char e_badfun[];
|
||||
@@ -228,12 +221,6 @@ extern __MANGLE__ const char e_cneedsarg[];
|
||||
extern __MANGLE__ const char e_mapping[];
|
||||
extern __MANGLE__ const char e_versions[];
|
||||
#endif /* SHOPT_FS_3D */
|
||||
#ifdef apollo
|
||||
extern __MANGLE__ const char e_rootnode[];
|
||||
extern __MANGLE__ const char e_nover[];
|
||||
extern __MANGLE__ const char e_badver[];
|
||||
extern __MANGLE__ const char e_badinlib[];
|
||||
#endif /* apollo */
|
||||
|
||||
/* for option parsing */
|
||||
extern __MANGLE__ const char sh_optalarm[];
|
||||
|
||||
@@ -172,8 +172,5 @@
|
||||
#else
|
||||
# define NMULTI NVPIX
|
||||
#endif /* SHOPT_MULTIBYTE */
|
||||
#ifdef apollo
|
||||
# define SYSTYPENOD (sh.bltin_nodes+51+NMULTI)
|
||||
#endif /* apollo */
|
||||
|
||||
#endif /* SH_VALNOD */
|
||||
|
||||
@@ -1,328 +0,0 @@
|
||||
/*
|
||||
* CDE - Common Desktop Environment
|
||||
*
|
||||
* Copyright (c) 1993-2012, The Open Group. All rights reserved.
|
||||
*
|
||||
* These libraries and programs are free software; you can
|
||||
* redistribute them and/or modify them under the terms of the GNU
|
||||
* Lesser General Public License as published by the Free Software
|
||||
* Foundation; either version 2 of the License, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* These libraries and programs are distributed in the hope that
|
||||
* they will be useful, but WITHOUT ANY WARRANTY; without even the
|
||||
* implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
* PURPOSE. See the GNU Lesser General Public License for more
|
||||
* details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with these libraries and programs; if not, write
|
||||
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
|
||||
* Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
/* $XConsortium: apollo.c /main/4 1996/10/04 15:52:17 drk $ */
|
||||
/***************************************************************
|
||||
* *
|
||||
* AT&T - PROPRIETARY *
|
||||
* *
|
||||
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF *
|
||||
* AT&T BELL LABORATORIES *
|
||||
* AND IS NOT TO BE DISCLOSED OR USED EXCEPT IN *
|
||||
* ACCORDANCE WITH APPLICABLE AGREEMENTS *
|
||||
* *
|
||||
* Copyright (c) 1995 AT&T Corp. *
|
||||
* Unpublished & Not for Publication *
|
||||
* All Rights Reserved *
|
||||
* *
|
||||
* The copyright notice above does not evidence any *
|
||||
* actual or intended publication of such source code *
|
||||
* *
|
||||
* This software was created by the *
|
||||
* Advanced Software Technology Department *
|
||||
* AT&T Bell Laboratories *
|
||||
* *
|
||||
* For further information contact *
|
||||
* {research,attmail}!dgk *
|
||||
* *
|
||||
***************************************************************/
|
||||
|
||||
/* : : generated by proto : : */
|
||||
|
||||
#if !defined(__PROTO__)
|
||||
#if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
|
||||
#if defined(__cplusplus)
|
||||
#define __MANGLE__ "C"
|
||||
#else
|
||||
#define __MANGLE__
|
||||
#endif
|
||||
#define __STDARG__
|
||||
#define __PROTO__(x) x
|
||||
#define __OTORP__(x)
|
||||
#define __PARAM__(n,o) n
|
||||
#if !defined(__STDC__) && !defined(__cplusplus)
|
||||
#if !defined(c_plusplus)
|
||||
#define const
|
||||
#endif
|
||||
#define signed
|
||||
#define void int
|
||||
#define volatile
|
||||
#define __V_ char
|
||||
#else
|
||||
#define __V_ void
|
||||
#endif
|
||||
#else
|
||||
#define __PROTO__(x) ()
|
||||
#define __OTORP__(x) x
|
||||
#define __PARAM__(n,o) o
|
||||
#define __MANGLE__
|
||||
#define __V_ char
|
||||
#define const
|
||||
#define signed
|
||||
#define void int
|
||||
#define volatile
|
||||
#endif
|
||||
#if defined(__cplusplus) || defined(c_plusplus)
|
||||
#define __VARARG__ ...
|
||||
#else
|
||||
#define __VARARG__
|
||||
#endif
|
||||
#if defined(__STDARG__)
|
||||
#define __VA_START__(p,a) va_start(p,a)
|
||||
#else
|
||||
#define __VA_START__(p,a) va_start(p)
|
||||
#endif
|
||||
#endif
|
||||
#include <ast.h>
|
||||
#include "defs.h"
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef apollo
|
||||
#include "/sys/ins/base.ins.c"
|
||||
#include "/sys/ins/pad.ins.c"
|
||||
#include "/sys/ins/error.ins.c"
|
||||
#include <sys/param.h> /* for maximum pathname length */
|
||||
#include <apollo/sys/ubase.h>
|
||||
#include <apollo/sys/name.h>
|
||||
#include <apollo/error.h>
|
||||
|
||||
int pad_create __PARAM__((char *fname), (fname)) __OTORP__(char *fname;){
|
||||
short oldfd = 1;
|
||||
short newfd;
|
||||
short size = 25;
|
||||
long st;
|
||||
|
||||
pad_$create (*fname, (short)strlen(fname), pad_$edit, oldfd,
|
||||
pad_$bottom, 0, size, newfd, st);
|
||||
if (st != 0)
|
||||
error(ERROR_system(1),e_open,"dm pad");
|
||||
return(newfd);
|
||||
}
|
||||
|
||||
pad_wait __PARAM__((int fd), (fd)) __OTORP__(int fd;){
|
||||
long st;
|
||||
|
||||
pad_$edit_wait((stream_$id_t)fd, st);
|
||||
|
||||
return (st == 0 ? 0 : 1);
|
||||
|
||||
}
|
||||
|
||||
char *apollo_error __PARAM__((void), ()){
|
||||
extern __MANGLE__ long unix_proc_$status;
|
||||
char subsys[80], module[80], code[80];
|
||||
short slen, mlen, clen;
|
||||
static char retstr[256];
|
||||
|
||||
error_$get_text (unix_proc_$status, subsys, slen,
|
||||
module, mlen, code, clen);
|
||||
subsys[slen] = module[mlen] = code[clen] = 0;
|
||||
if (clen == 0)
|
||||
sprintf (code, "status 0x%08lx", unix_proc_$status);
|
||||
if ( mlen )
|
||||
sprintf(retstr, "%s (%s/%s)", code, subsys, module );
|
||||
else
|
||||
sprintf(retstr, "%s (%s)", code, subsys );
|
||||
|
||||
return (retstr);
|
||||
}
|
||||
|
||||
/*
|
||||
* declarations to support the apollo builtin commands
|
||||
* rootnode, inlib, and ver.
|
||||
*/
|
||||
|
||||
static char last_rootnode[MAXPATHLEN] = "/";
|
||||
static char do_ver;
|
||||
static char *preval = NULL, *sysval, *sysid = "SYSTYPE";
|
||||
|
||||
/*
|
||||
* code to support the apollo builtin functions rootnode,
|
||||
* inlib, and ver.
|
||||
*/
|
||||
|
||||
int b_rootnode __PARAM__((int argn,char *argv[]), (argn, argv)) __OTORP__(int argn;char *argv[];){
|
||||
if (argn == 1)
|
||||
{ /* report current setting */
|
||||
sfprintf(sfstdout,"%s\n",last_rootnode);
|
||||
return(0);
|
||||
}
|
||||
if (!is_valid_rootnode(argv[1]))
|
||||
sh_cfail(e_rootnode);
|
||||
if (rootnode(argv[1]) != 0)
|
||||
{
|
||||
perror("rootnode: "); /* ? */
|
||||
sh_cfail(e_rootnode);
|
||||
}
|
||||
if (argn == 2)
|
||||
strcpy(last_rootnode, argv[1]);
|
||||
else
|
||||
{
|
||||
sysval = argv[1];
|
||||
sh_eval(sh_sfeval(argv),0);
|
||||
if (rootnode(last_rootnode) != 0)
|
||||
sh_cfail(e_rootnode);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
int b_ver __PARAM__((int argn,char *argv[]), (argn, argv)) __OTORP__(int argn;char *argv[];){
|
||||
char *oldver;
|
||||
short i1, i2;
|
||||
std_$call unsigned char c_$decode_version(__VARARG__);
|
||||
|
||||
oldver = SYSTYPENOD->namval.cp;
|
||||
if (argn == 1 || argn > 2)
|
||||
{
|
||||
sysval = NULL;
|
||||
if (oldver)
|
||||
preval = sysval = oldver;
|
||||
}
|
||||
if (argn == 1)
|
||||
{
|
||||
if (!oldver || !sysval)
|
||||
sh_cfail(e_nover);
|
||||
else
|
||||
{
|
||||
sfprintf(sfstdout,"%s\n",sysval);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!c_$decode_version (*argv[1], (short) strlen (argv[1]), i1, i2))
|
||||
sh_cfail(e_badver);
|
||||
else
|
||||
{
|
||||
if (argn == 2)
|
||||
{
|
||||
short namlen = strlen(sysid);
|
||||
short arglen = strlen(argv[1]);
|
||||
|
||||
nv_unset(SYSTYPENOD);
|
||||
nv_putval(SYSTYPENOD, argv[1],NV_RDONLY);
|
||||
nv_onattr(SYSTYPENOD, NV_EXPORT | NV_NOFREE);
|
||||
ev_$set_var (sysid, &namlen, argv[1], &arglen);
|
||||
}
|
||||
else
|
||||
{
|
||||
int fd;
|
||||
short namlen = strlen(sysid);
|
||||
short arglen = strlen(argv[1]);
|
||||
|
||||
sysval = argv[1];
|
||||
argv = &argv[2];
|
||||
sh_eval(sh_sfeval(argv),0);
|
||||
ev_$set_var(sysid, &namlen, sysval, &arglen);
|
||||
if((fd=path_open(argv[0],path_get(argv[0]))) < 0)
|
||||
{
|
||||
arglen = (short)strlen(preval);
|
||||
ev_$set_var (sysid, &namlen, preval, &arglen);
|
||||
error(ERROR_system(1),e_open,argv[0]);
|
||||
}
|
||||
close(fd);
|
||||
sh_eval(sfopen(argv[0],"s"),0);
|
||||
arglen = (short)strlen(preval);
|
||||
ev_$set_var (sysid, &namlen, preval, &arglen);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(sh.exitval);
|
||||
}
|
||||
|
||||
/*
|
||||
* rootnode.c - a chroot call which doesn't require you to be root...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Changes:
|
||||
01/24/88 brian Initial coding
|
||||
*/
|
||||
|
||||
|
||||
#ifndef NULL
|
||||
# define NULL ((__V_ *) 0)
|
||||
#endif
|
||||
|
||||
extern __MANGLE__ boolean
|
||||
unix_fio_$status_to_errno __PROTO__((
|
||||
status_$t & status,
|
||||
char * pn,
|
||||
short & pnlen
|
||||
));
|
||||
|
||||
is_valid_rootnode __PARAM__((const char *path), (path)) __OTORP__(const char *path;){
|
||||
if (geteuid() == 0)
|
||||
return 1;
|
||||
return (path[0] == '/' && path[1] == '/' && path[2] != '\0' &&
|
||||
strchr(&path[2], '/') == NULL);
|
||||
}
|
||||
|
||||
rootnode __PARAM__((char * path), (path)) __OTORP__(char * path;){
|
||||
uid_$t dir_uid, rtn_uid;
|
||||
name_$pname_t new_root_name, rest_path;
|
||||
name_$name_t leaf;
|
||||
short rest_len, leaf_len, err;
|
||||
status_$t status;
|
||||
|
||||
strcpy(new_root_name, path);
|
||||
|
||||
name_$resolve_afayc(new_root_name, (short)strlen(new_root_name),
|
||||
&dir_uid, &rtn_uid, rest_path, &rest_len, leaf, &leaf_len, &err, &status);
|
||||
|
||||
if (status.all != status_$ok) {
|
||||
unix_fio_$status_to_errno(status, path, strlen(path));
|
||||
return (-1);
|
||||
}
|
||||
|
||||
name_$set_diru(rtn_uid, rest_path, (short) rest_len, name_$node_dir_type, &status);
|
||||
|
||||
if (status.all != status_$ok) {
|
||||
unix_fio_$status_to_errno(status, path, strlen(path));
|
||||
return(-1);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
#endif /* apollo */
|
||||
|
||||
/*
|
||||
* Apollo system support library loads into the virtual address space
|
||||
*/
|
||||
|
||||
int b_inlib(argc,argv)
|
||||
char **argv;
|
||||
{
|
||||
register char *a1 = argv[1];
|
||||
int status;
|
||||
short len;
|
||||
std_$call void loader_$inlib(__VARARG__);
|
||||
if(sh.subshell)
|
||||
sh_subfork();
|
||||
if(a1)
|
||||
{
|
||||
len = strlen(a1);
|
||||
loader_$inlib(*a1, len, status);
|
||||
if(status!=0)
|
||||
error(3, e_badinlib);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
@@ -236,15 +236,6 @@ static void put_restricted __PARAM__((register Namval_t* np,const char *val,int
|
||||
nv_putv(np, val, flags, fp);
|
||||
}
|
||||
|
||||
#ifdef apollo
|
||||
/* Trap for SYSTYPE variable */
|
||||
static void put_systype __PARAM__((Namval_t* np,const char *val,int flags,Namfun_t *fp), (np, val, flags, fp)) __OTORP__(Namval_t* np;const char *val;int flags;Namfun_t *fp;){
|
||||
sh.lastpath = 0;
|
||||
nv_scan(sh.track_tree,rehash,NV_TAGGED,NV_TAGGED);
|
||||
nv_putv(np, val, flags, fp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef _hdr_locale
|
||||
|
||||
/*
|
||||
@@ -391,7 +382,6 @@ static MsgStr allmsgs[] = {
|
||||
{"Resources lost", 25, 125},
|
||||
{"Reverting to old tty driver...", 25, 126},
|
||||
{"S [mask]", 25, 127},
|
||||
{"SIGAPOLLO", 25, 128},
|
||||
{"Security label changed", 25, 129},
|
||||
{"Socket interrupt", 25, 130},
|
||||
{"Sound completed", 25, 131},
|
||||
@@ -1080,10 +1070,6 @@ static Namfun_t L_ARG_init = { &L_ARG_disc};
|
||||
static Namfun_t LC_ALL_init = { &LC_disc};
|
||||
static Namfun_t LANG_init = { &LC_disc};
|
||||
#endif /* _hdr_locale */
|
||||
#ifdef apollo
|
||||
static const Namdisc_t SYSTYPE_disc = { 0, put_systype };
|
||||
static Namfun_t SYSTYPE_init = { &SYSTYPEdisc};
|
||||
#endif /* apollo */
|
||||
#ifdef SHOPT_MULTIBYTE
|
||||
static const Namdisc_t CSWIDTH_disc = { 0, put_cswidth };
|
||||
static Namfun_t CSWIDTH_init = { &CSWIDTH_disc};
|
||||
@@ -1294,9 +1280,6 @@ static void nv_init __PARAM__((void), ()){
|
||||
nv_stack(LCNUMNOD, &LC_NUM_init);
|
||||
nv_stack(LANGNOD, &LANG_init);
|
||||
#endif /* _hdr_locale */
|
||||
#ifdef apollo
|
||||
nv_stack(SYSTYPENOD, &SYSTYPE_init);
|
||||
#endif /* apollo */
|
||||
#ifdef SHOPT_MULTIBYTE
|
||||
nv_stack(CSWIDTHNOD, &CSWIDTH_init);
|
||||
#endif /* SHOPT_MULTIBYTE */
|
||||
|
||||
@@ -1422,16 +1422,7 @@ static void job_free __PARAM__((register int n), (n)) __OTORP__(register int n;)
|
||||
|
||||
static char *job_sigmsg __PARAM__((int sig), (sig)) __OTORP__(int sig;){
|
||||
static char signo[] = "Signal xxxx";
|
||||
#ifdef apollo
|
||||
/*
|
||||
* This code handles the formatting for the apollo specific signal
|
||||
* SIGAPOLLO.
|
||||
*/
|
||||
extern __MANGLE__ char *apollo_error __PROTO__((void));
|
||||
|
||||
if ( sig == SIGAPOLLO )
|
||||
return( apollo_error() );
|
||||
#endif /* apollo */
|
||||
|
||||
if(sig<sh.sigmax && sh.sigmsg[sig])
|
||||
return(sh.sigmsg[sig]);
|
||||
#if defined(SIGRTMIN) && defined(SIGRTMAX)
|
||||
|
||||
@@ -101,11 +101,6 @@
|
||||
#include "FEATURE/locale"
|
||||
#include "national.h"
|
||||
|
||||
#ifdef apollo
|
||||
extern __MANGLE__ void ev_$delete_var(__VARARG__);
|
||||
extern __MANGLE__ void ev_$set_var(__VARARG__);
|
||||
#endif /* apollo */
|
||||
|
||||
static void attstore __PROTO__((Namval_t*));
|
||||
static void pushnam __PROTO__((Namval_t*));
|
||||
static char *staknam __PROTO__((Namval_t*, char*));
|
||||
@@ -523,22 +518,7 @@ Namval_t *nv_open __PARAM__((const char *name,Hashtab_t *root,int flags), (name,
|
||||
#endif /* SHOPT_BSH */
|
||||
}
|
||||
nv_onattr(np, flags&NV_ATTRIBUTES);
|
||||
#ifdef apollo
|
||||
/*
|
||||
* Set environment variable defined in the underlying
|
||||
* DOMAIN_OS cache. This is done because dsee will only
|
||||
* process the path if it has changed since the last
|
||||
* time it looked.
|
||||
*/
|
||||
if(nv_isattr(np,NV_EXPORT) && !nv_isattr(np,NV_IMPORT)
|
||||
&& (flags&NV_ASSIGN) && !(flags&(NV_NOSCOPE|NV_ARRAY)))
|
||||
{
|
||||
short namlen,vallen;
|
||||
namlen =strlen(nv_name(np));
|
||||
vallen = strlen(cp);
|
||||
ev_$set_var(nv_name(np),&namlen,cp,&vallen);
|
||||
}
|
||||
#endif /* apollo */
|
||||
|
||||
/*
|
||||
* Set environment variable defined in the underlying
|
||||
* libc environ. This is done because routines within
|
||||
@@ -657,21 +637,7 @@ void nv_putval __PARAM__((register Namval_t *np, const char *string, int flags),
|
||||
const char *tofree=0;
|
||||
if(flags&NV_INTEGER)
|
||||
sp = sh_etos(*((double*)sp),12);
|
||||
#ifdef apollo
|
||||
if(nv_isattr(np, NV_HOST)==NV_HOST && sp)
|
||||
{
|
||||
/*
|
||||
* return the host file name given the UNIX name
|
||||
* non-unix hosts that use file name mapping
|
||||
* should change this
|
||||
*/
|
||||
char pathname[1024];
|
||||
short pathlen;
|
||||
unix_fio_$get_name(sp,pathname,&pathlen);
|
||||
pathname[pathlen] = 0;
|
||||
sp = pathname;
|
||||
}
|
||||
#endif /* apollo */
|
||||
|
||||
if((nv_isattr(np, NV_RJUST|NV_ZFILL|NV_LJUST)) && sp)
|
||||
{
|
||||
for(;*sp == ' '|| *sp=='\t';sp++);
|
||||
@@ -734,16 +700,6 @@ void nv_putval __PARAM__((register Namval_t *np, const char *string, int flags),
|
||||
if(tofree)
|
||||
free((__V_*)tofree);
|
||||
}
|
||||
#ifdef apollo
|
||||
if((flags&NV_RDONLY) && nv_isattr(np,NV_EXPORT))
|
||||
{
|
||||
short namlen, vallen;
|
||||
char *vp = nv_getval(np);
|
||||
namlen =strlen(nv_name(np));
|
||||
vallen = strlen(vp);
|
||||
ev_$set_var(nv_name(np),&namlen,vp,&vallen);
|
||||
}
|
||||
#endif /* apollo */
|
||||
/*
|
||||
* Set environment variable defined in the underlying
|
||||
* libc environ. This is done because routines within
|
||||
@@ -1200,21 +1156,7 @@ void nv_newattr __PARAM__((register Namval_t *np, unsigned newatts, int size),
|
||||
if(newatts&NV_EXPORT)
|
||||
nv_offattr(np,NV_IMPORT);
|
||||
#endif /* SHOPT_BSH */
|
||||
#ifdef apollo
|
||||
if(((n^newatts)&NV_EXPORT))
|
||||
/* record changes to the environment */
|
||||
{
|
||||
short namlen = strlen(nv_name(np));
|
||||
if(n&NV_EXPORT)
|
||||
ev_$delete_var(nv_name(np),&namlen);
|
||||
else
|
||||
{
|
||||
char *vp = nv_getval(np);
|
||||
short vallen = strlen(vp);
|
||||
ev_$set_var(nv_name(np),&namlen,vp,&vallen);
|
||||
}
|
||||
}
|
||||
#endif /* apollo */
|
||||
|
||||
/*
|
||||
* Set environment variable defined in the underlying
|
||||
* libc environ. This is done because routines within
|
||||
|
||||
@@ -745,18 +745,9 @@ static char *execs __PARAM__((const char *ap,const char *arg0,register char **ar
|
||||
#endif /* SHELLMAGIC */
|
||||
switch(errno)
|
||||
{
|
||||
#ifdef apollo
|
||||
/*
|
||||
* On apollo's execve will fail with eacces when
|
||||
* file has execute but not read permissions. So,
|
||||
* for now we will pretend that EACCES and ENOEXEC
|
||||
* mean the same thing.
|
||||
*/
|
||||
case EACCES:
|
||||
#endif /* apollo */
|
||||
case ENOEXEC:
|
||||
exscript(path,argv);
|
||||
#ifndef apollo
|
||||
|
||||
case EACCES:
|
||||
{
|
||||
struct stat statb;
|
||||
@@ -764,7 +755,7 @@ static char *execs __PARAM__((const char *ap,const char *arg0,register char **ar
|
||||
errno = EISDIR;
|
||||
}
|
||||
/* FALL THROUGH */
|
||||
#endif /* !apollo */
|
||||
|
||||
#ifdef ENAMETOOLONG
|
||||
case ENAMETOOLONG:
|
||||
#endif /* ENAMETOOLONG */
|
||||
|
||||
Reference in New Issue
Block a user