VirtualBox

Changeset 881 in kBuild for trunk


Ignore:
Timestamp:
Apr 21, 2007 8:47:37 AM (18 years ago)
Author:
bird
Message:

hacking...

Location:
trunk/src/ash-messup
Files:
1 added
9 edited

Legend:

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

    r868 r881  
    102102# Use the pregenerated code.
    103103#
    104 kmk_ash_DEPS :=Ä
     104kmk_ash_DEPS := 
    105105
    106106define def_copy_generated
     
    111111endef
    112112
    113 $(foreach src, arith.h arith.c arith_lex.c builtins.h builtins.c nodes.h nodes.c token.h init.c,\
    114 $(eval $(def_copy_generated)))
     113#$(foreach src, arith.h arith.c arith_lex.c builtins.h builtins.c nodes.h nodes.c token.h init.c,\
     114#$(eval $(def_copy_generated)))
     115
     116kmk_ash_INCS += generated
    115117
    116118include $(PATH_KBUILD)/footer.kmk
  • trunk/src/ash-messup/error.h

    r879 r881  
    8686#define INTOFF psh->suppressint++
    8787#define INTON { if (--psh->suppressint == 0 && psh->intpending) onint(psh); }
    88 #define FORCEINTON {suppressint = 0; if (psh->intpending) onint(psh);}
     88#define FORCEINTON {psh->suppressint = 0; if (psh->intpending) onint(psh);}
    8989#define CLEAR_PENDING_INT psh->intpending = 0
    9090#define int_pending() psh->intpending
  • trunk/src/ash-messup/main.c

    r880 r881  
    7878#include "exec.h"
    7979#include "cd.h"
     80#include "shinstance.h"
    8081
    8182#define PROFILE 0
     
    8687STATIC union node *prevcmd;
    8788
    88 STATIC void read_profile(const char *);
    89 STATIC char *find_dot_file(char *);
     89STATIC void read_profile(struct shinstance *, const char *);
     90STATIC char *find_dot_file(struct shinstance *, char *);
    9091int main(int, char **);
    9192int shell_main(shinstance *, int, char **);
     
    121122                return 2;
    122123        shthread_set_shell(psh);
    123         return shell_main(psh, argc);
     124        return shell_main(psh, argc, argv);
    124125}       
    125126
     
    144145                        psh->rootshell = 1;
    145146                        psh->minusc = NULL;
    146                         psh->state = 3;
     147                        state = 3;
    147148                        break;
    148149
     
    160161
    161162                if (psh->exception != EXSHELLPROC) {
    162                         if (state == 0 || iflag == 0 || ! psh->rootshell)
    163                                 exitshell(psh, exitstatus);
     163                        if (state == 0 || psh->iflag == 0 || ! psh->rootshell)
     164                                exitshell(psh, psh->exitstatus);
    164165                }
    165166                reset(psh);
     
    170171                 ) {
    171172                        out2c(psh, '\n');
    172                         flushout(&errout);
     173                        flushout(&psh->errout);
    173174                }
    174175                popstackmark(psh, &smark);
     
    232233                evalstring(psh, psh->minusc, 0);
    233234
    234         if (psh->sflag || minusc == NULL) {
     235        if (psh->sflag || psh->minusc == NULL) {
    235236state4: /* XXX ??? - why isn't this before the "if" statement */
    236237                cmdloop(psh, 1);
     
    238239        exitshell(psh, psh->exitstatus);
    239240        /* NOTREACHED */
     241        return 1;
    240242}
    241243
     
    343345                setinputfd(psh, fd, 1);
    344346        else
    345                 error("Can't open %s", name);
     347                error(psh, "Can't open %s", name);
    346348        INTON;
    347349        cmdloop(psh, 0);
     
    380382
    381383        /* not found in the PATH */
    382         error("%s: not found", basename);
     384        error(psh, "%s: not found", basename);
    383385        /* NOTREACHED */
     386        return NULL;
    384387}
    385388
     
    412415        if (argc > 1)
    413416                psh->exitstatus = number(argv[1]);
    414         exitshell(psh, exitstatus);
     417        exitshell(psh, psh->exitstatus);
    415418        /* NOTREACHED */
     419        return 1;
    416420}
    417421
  • trunk/src/ash-messup/shinstance.h

    r880 r881  
    2727#include "shtypes.h"
    2828#include "shthread.h"
    29 
    30 /**
    31  * One file.
    32  */
    33 typedef struct shfile
    34 {
    35     int                 fd;             /**< The shell file descriptor number. */
    36     int                 flags;          /**< Open flags. */
    37     intptr_t            native;         /**< The native file descriptor number. */
    38 } shfile;
    39 
    40 /**
    41  * The file descriptor table for a shell.
    42  */
    43 typedef struct shfdtab
    44 {
    45     shmtx               mtx;            /**< Mutex protecting any operations on the table and it's handles. */
    46     unsigned            size;           /**< The size of the table (number of entries). */
    47     shfile             *tab;            /**< Pointer to the table. */
    48 } shfdtab;
     29#include "shfile.h"
    4930
    5031/**
     
    155136
    156137    /* builtins.h */
    157     const char         *commandname;
    158138
    159139} shinstance;
  • trunk/src/ash-messup/shthread.h

    r879 r881  
    2727
    2828#include <sys/types.h>
    29 struct shmtx;
    30 typedef unsigned long shthread;
     29
     30typedef struct shmtx
     31{
     32    char b[64];
     33} shmtx;
     34
     35typedef uintptr_t shtid;
     36
     37void shthread_set_shell(struct shinstance *);
     38struct shinstance *shthread_get_shell(void);
  • trunk/src/ash-messup/shtypes.h

    r879 r881  
    3232
    3333#ifdef _MSC_VER
     34#include <io.h> /* intptr_t and uintptr_t */
    3435typedef signed char     int8_t;
    3536typedef unsigned char   uint8_t;
     
    4041typedef _int64          int64_t;
    4142typedef unsigned _int64 uint64_t;
    42 # if defined(__X86__) || defined(_X86_) || defined(_M_IX86)
    43 typedef signed long     intptr_t;
    44 typedef unsigned long   uintptr_t;
    45 # else
    46 typedef int64_t         intptr_t;
    47 typedef uint64_t        uintptr_t;
    48 # endif
    4943
    5044#define INT16_C(c)      (c)
     
    7973#endif
    8074
     75struct shinstance;
     76typedef struct shinstance shinstance;
     77
    8178#endif
    8279
  • trunk/src/ash-messup/trap.h

    r879 r881  
    4242void ignoresig(struct shinstance *, int, int);
    4343void onsig(struct shinstance *, int);
    44 void dotrap(struct shinstance *, void);
     44void dotrap(struct shinstance *);
    4545void setinteractive(struct shinstance *, int);
    4646void exitshell(struct shinstance *, int) __attribute__((__noreturn__));
  • trunk/src/ash-messup/win/mscfakes.h

    r785 r881  
    112112#define fchown(fd,uid,gid) 0
    113113#define fchmod(fd, mode) 0              /** @todo implement fchmod! */
    114 #define geteuid()  0
    115114#define lstat(path, s) stat(path, s)
    116115#define lchmod(path, mod) chmod(path, mod)
  • trunk/src/ash-messup/win/unistd.h

    r819 r881  
    66long _sysconf(int);
    77pid_t fork(void);
    8 pid_t getpid(void);
     8#define getpid _getpid
    99
     10uid_t getuid(void);
     11uid_t geteuid(void);
     12gid_t getgid(void);
     13gid_t getegid(void);
     14
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette