Changeset 809 for trunk/src/ash


Ignore:
Timestamp:
Jan 29, 2007, 6:54:36 AM (19 years ago)
Author:
bird
Message:

Solaris + cleanup.

Location:
trunk/src/ash
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/ash/Makefile.kmk

    r785 r809  
    1616kmk_ash_DEFS = lint SHELL SMALL
    1717kmk_ash_DEFS.linux = BSD
     18kmk_ash_DEFS.solaris = BSD
    1819kmk_ash_DEFS.win = \
    1920        BSD PC_PATH_SEP PC_DRIVE_LETTERS PC_EXE_EXTS
     
    6768        win/err.c \
    6869        win/dirent.c \
     70        sys_signame.c \
     71        strlcpy.c \
     72        setmode.c
     73kmk_ash_SOURCES.solaris = \
    6974        sys_signame.c \
    7075        strlcpy.c \
  • trunk/src/ash/alias.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/arith.y

    r626 r809  
    3434 */
    3535
     36#ifdef HAVE_SYS_CDEFS_H
    3637#include <sys/cdefs.h>
     38#endif
    3739#ifndef lint
    3840#if 0
  • trunk/src/ash/arith_lex.l

    r626 r809  
    3535 */
    3636
     37#ifdef HAVE_SYS_CDEFS_H
    3738#include <sys/cdefs.h>
     39#endif
    3840#ifndef lint
    3941#if 0
  • trunk/src/ash/bltin/kill.c

    r632 r809  
    3030 */
    3131
     32#ifndef __sun__
    3233#include <sys/cdefs.h>
     34#endif
    3335#if !defined(lint) && !defined(SHELL)
    3436__COPYRIGHT("@(#) Copyright (c) 1988, 1993, 1994\n\
     
    4547
    4648#include <ctype.h>
     49#ifndef __sun__
    4750#include <err.h>
     51#endif
    4852#include <errno.h>
    4953#include <signal.h>
  • trunk/src/ash/bltin/test.c

    r632 r809  
    1111 */
    1212
     13#ifndef __sun__
    1314#include <sys/cdefs.h>
     15#endif
    1416#ifndef lint
    1517__RCSID("$NetBSD: test.c,v 1.26 2005/02/10 06:56:55 simonb Exp $");
     
    2022
    2123#include <ctype.h>
     24#ifndef __sun__
    2225#include <err.h>
     26#endif
    2327#include <errno.h>
    2428#include <stdio.h>
  • trunk/src/ash/cd.c

    r626 r809  
    3333 */
    3434
     35#ifndef __sun__
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/error.c

    r632 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/eval.c

    r629 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    5355#ifdef HAVE_SYSCTL_H
    5456#include <sys/sysctl.h>
     57#endif
     58#ifdef __sun__
     59#include <iso/limits_iso.h>
    5560#endif
    5661
     
    609614        static char *sys_path = NULL;
    610615        static int mib[] = {CTL_USER, USER_CS_PATH};
    611 #endif 
     616#endif
    612617#ifdef PC_PATH_SEP
    613618        static char def_path[] = "PATH=/usr/bin;/bin;/usr/sbin;/sbin";
     
    632637#else
    633638    return def_path;
    634 #endif 
     639#endif
    635640}
    636641
  • trunk/src/ash/exec.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/expand.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    5153#include <stdlib.h>
    5254#include <stdio.h>
     55#ifdef __sun__
     56#include <iso/limits_iso.h>
     57#endif
    5358
    5459/*
     
    101106STATIC void varvalue(char *, int, int, int);
    102107STATIC void recordregion(int, int, int);
    103 STATIC void removerecordregions(int); 
     108STATIC void removerecordregions(int);
    104109STATIC void ifsbreakup(char *, struct arglist *);
    105110STATIC void ifsfree(void);
     
    305310
    306311
    307 STATIC void 
     312STATIC void
    308313removerecordregions(int endoff)
    309314{
     
    328333                return;
    329334        }
    330        
     335
    331336        ifslastp = &ifsfirst;
    332337        while (ifslastp->next && ifslastp->next->begoff < endoff)
     
    562567                        loc--;
    563568                        if ((varflags & VSQUOTE) && loc > startp &&
    564                             *(loc - 1) == CTLESC) { 
     569                            *(loc - 1) == CTLESC) {
    565570                                for (q = startp; q < loc; q++)
    566571                                        if (*q == CTLESC)
     
    740745                if (subevalvar(p, var, 0, subtype, startloc, varflags)) {
    741746                        varflags &= ~VSNUL;
    742                         /* 
    743                          * Remove any recorded regions beyond 
    744                          * start of variable 
     747                        /*
     748                         * Remove any recorded regions beyond
     749                         * start of variable
    745750                         */
    746751                        removerecordregions(startloc);
  • trunk/src/ash/histedit.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    4345
    4446#include <sys/param.h>
     47#ifndef __sun__
    4548#include <paths.h>
     49#endif
    4650#include <stdio.h>
    4751#include <stdlib.h>
     
    154158                        else if (Eflag)
    155159                                el_set(el, EL_EDITOR, "emacs");
    156                         el_set(el, EL_BIND, "^I", 
     160                        el_set(el, EL_BIND, "^I",
    157161                            tabcomplete ? "rl-complete" : "ed-insert", NULL);
    158162                        el_source(el, NULL);
  • trunk/src/ash/input.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    4850#include <stdlib.h>
    4951#include <string.h>
     52#ifdef __sun__
     53#include <iso/limits_iso.h>
     54#endif
    5055
    5156/*
  • trunk/src/ash/jobs.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#else
     38#define _PATH_DEVNULL "/dev/null"
     39#endif
    3640#ifndef lint
    3741#if 0
     
    4347
    4448#include <fcntl.h>
     49#ifdef __sun__
     50#define sys_siglist _sys_siglist
     51#endif
    4552#include <signal.h>
    4653#include <errno.h>
    4754#include <unistd.h>
    4855#include <stdlib.h>
     56#ifndef __sun__
    4957#include <paths.h>
     58#endif
    5059#include <sys/types.h>
    5160#include <sys/param.h>
    52 #ifdef BSD
     61#if defined(BSD) || defined(__sun__)
    5362#include <sys/wait.h>
    5463#include <sys/time.h>
     
    688697        int i;
    689698        const char *err_msg = "No such job: %s";
    690                
     699
    691700        if (name == NULL) {
    692701#if JOBS
  • trunk/src/ash/mail.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/main.c

    r638 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739__COPYRIGHT("@(#) Copyright (c) 1991, 1993\n\
     
    179181        init_syntax();
    180182    }
    181 #endif 
     183#endif
    182184        init();
    183185        setstackmark(&smark);
     
    202204        if (sflag == 0 || minusc) {
    203205                static int sigs[] =  {
    204                     SIGINT, SIGQUIT, SIGHUP, 
     206                    SIGINT, SIGQUIT, SIGHUP,
    205207#ifdef SIGTSTP
    206208                    SIGTSTP,
  • trunk/src/ash/memalloc.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    224226                /*
    225227                 * Stack marks pointing to the start of the old block
    226                  * must be relocated to point to the new block 
     228                 * must be relocated to point to the new block
    227229                 */
    228230                xmark = markp;
  • trunk/src/ash/miscbltin.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/mkbuiltins

    r629 r809  
    1 #!/bin/sh -
     1#!/bin/sh -x
    22#       $NetBSD: mkbuiltins,v 1.21 2004/06/06 07:03:11 christos Exp $
    33#
     
    6666 */
    6767
     68#ifdef HAVE_SYS_CDEFS_H
    6869#include <sys/cdefs.h>
     70#endif
    6971
    7072struct builtincmd {
  • trunk/src/ash/mystring.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/options.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/output.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/parser.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    4345
    4446#include <stdlib.h>
     47#ifdef __sun__
     48#include <iso/limits_iso.h>
     49#endif
    4550
    4651#include "shell.h"
     
    746751                                if (**pp == *wordtext && equal(*pp, wordtext))
    747752                                {
    748                                         lasttoken = t = pp - 
     753                                        lasttoken = t = pp -
    749754                                            parsekwd + KWDOFFSET;
    750755                                        TRACE(("keyword %s recognized\n", tokname[t]));
  • trunk/src/ash/redir.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/shell.h

    r626 r809  
    7070#define MKINIT  /* empty */
    7171
     72#ifdef HAVE_SYS_CDEFS_H
    7273#include <sys/cdefs.h>
     74#endif
    7375
    7476extern char nullstr[1];         /* null string */
  • trunk/src/ash/show.c

    r626 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
  • trunk/src/ash/syntax.c

    r638 r809  
    11/*      $NetBSD: syntax.c,v 1.1 2004/01/17 17:38:12 dsl Exp $   */
     2
     3#ifdef __sun__
     4#include <stdio.h>
     5#include <iso/limits_iso.h>
     6#endif
    27
    38#include "shell.h"
  • trunk/src/ash/syntax.h

    r638 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#include <ctype.h>
    3739
     
    8991extern const char arisyntax[];
    9092extern const char is_type[];
    91 #endif 
     93#endif
  • trunk/src/ash/trap.c

    r630 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    6466extern void init_sys_signame(void);
    6567extern char sys_signame[NSIG][16];
    66 #endif 
     68#endif
    6769
    6870/*
     
    8486int pendingsigs;                /* indicates some signal received */
    8587
     88#ifdef __sun__
     89typedef void (*sig_t) (int);
     90#endif
    8691static int getsigaction(int, sig_t *);
    8792
     
    101106        if (strcasecmp(p, "exit") == 0 )
    102107                return 0;
    103        
     108
    104109        if (strncasecmp(p, "sig", 3) == 0)
    105110                p += 3;
     
    107112#ifndef HAVE_SYS_SIGNAME
    108113        init_sys_signame();
    109 #endif 
     114#endif
    110115        for (i = 0; i < NSIG; ++i)
    111116                if (strcasecmp (p, sys_signame[i]) == 0)
     
    125130#ifndef HAVE_SYS_SIGNAME
    126131        init_sys_signame();
    127 #endif 
     132#endif
    128133
    129134        for (n = 1; n < NSIG; n++) {
     
    148153#ifndef HAVE_SYS_SIGNAME
    149154        init_sys_signame();
    150 #endif 
     155#endif
    151156
    152157        if (argc <= 1) {
  • trunk/src/ash/var.c

    r637 r809  
    3333 */
    3434
     35#ifdef HAVE_SYS_CDEFS_H
    3536#include <sys/cdefs.h>
     37#endif
    3638#ifndef lint
    3739#if 0
     
    4547#include <stdlib.h>
    4648#include <strings.h>
     49#ifndef __sun__
    4750#include <paths.h>
     51#else
     52#define _PATH_DEFPATH        "/usr/bin:/usr/sbin"
     53#include <iso/limits_iso.h>
     54#endif
    4855
    4956#ifdef PC_OS2_LIBPATHS
     
    123130#ifdef _MSC_VER
    124131struct var vpath2;
    125 #endif 
     132#endif
    126133struct var vps1;
    127134struct var vps2;
     
    155162        { &vpath2,      VSTRFIXED|VTEXTFIXED,           "Path=",
    156163          changepath },
    157 #endif 
     164#endif
    158165        /*
    159166         * vps1 depends on uid
Note: See TracChangeset for help on using the changeset viewer.