Ignore:
Timestamp:
Oct 7, 2007, 12:04:05 AM (18 years ago)
Author:
bird
Message:

moving globals into shinstance...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/miscbltin.c

    r1198 r1199  
    113113
    114114        if (prompt && isatty(0)) {
    115                 out2str(prompt);
    116                 output_flushall();
     115                out2str(psh, prompt);
     116                output_flushall(psh);
    117117        }
    118118
    119119        if (*(ap = argptr) == NULL)
    120                 error("arg count");
     120                error(psh, "arg count");
    121121
    122122        if ((ifs = bltinlookup("IFS", 1)) == NULL)
     
    261261                        o[i] = '\0';
    262262
    263                         out1fmt("u=%s,g=%s,o=%s\n", u, g, o);
     263                        out1fmt(psh, "u=%s,g=%s,o=%s\n", u, g, o);
    264264                } else {
    265                         out1fmt("%.4o\n", mask);
     265                        out1fmt(psh, "%.4o\n", mask);
    266266                }
    267267        } else {
     
    270270                        do {
    271271                                if (*ap >= '8' || *ap < '0')
    272                                         error("Illegal number: %s", argv[1]);
     272                                        error(psh, "Illegal number: %s", argv[1]);
    273273                                mask = (mask << 3) + (*ap - '0');
    274274                        } while (*++ap != '\0');
     
    288288                        INTON;
    289289                        if (!set)
    290                                 error("Illegal mode: %s", ap);
     290                                error(psh, "Illegal mode: %s", ap);
    291291
    292292                        umask(~mask & 0777);
     
    384384                ;
    385385        if (!l->name)
    386                 error("internal error (%c)", what);
     386                error(psh, "internal error (%c)", what);
    387387
    388388        set = *argptr ? 1 : 0;
     
    391391
    392392                if (all || argptr[1])
    393                         error("too many arguments");
     393                        error(psh, "too many arguments");
    394394                if (strcmp(p, "unlimited") == 0)
    395395                        val = RLIM_INFINITY;
     
    404404                        }
    405405                        if (c)
    406                                 error("bad number");
     406                                error(psh, "bad number");
    407407                        val *= l->factor;
    408408                }
     
    416416                                val = limit.rlim_max;
    417417
    418                         out1fmt("%-20s ", l->name);
     418                        out1fmt(psh, "%-20s ", l->name);
    419419                        if (val == RLIM_INFINITY)
    420420                                out1fmt("unlimited\n");
     
    423423                                val /= l->factor;
    424424#ifdef BSD4_4
    425                                 out1fmt("%lld\n", (long long) val);
     425                                out1fmt(psh, "%lld\n", (long long) val);
    426426#else
    427                                 out1fmt("%ld\n", (long) val);
     427                                out1fmt(psh, "%ld\n", (long) val);
    428428#endif
    429429                        }
     
    439439                        limit.rlim_cur = val;
    440440                if (setrlimit(l->cmd, &limit) < 0)
    441                         error("error setting limit (%s)", strerror(errno));
     441                        error(psh, "error setting limit (%s)", strerror(errno));
    442442        } else {
    443443                if (how & SOFT)
     
    447447
    448448                if (val == RLIM_INFINITY)
    449                         out1fmt("unlimited\n");
     449                        out1fmt(psh, "unlimited\n");
    450450                else
    451451                {
    452452                        val /= l->factor;
    453453#ifdef BSD4_4
    454                         out1fmt("%lld\n", (long long) val);
     454                        out1fmt(psh, "%lld\n", (long long) val);
    455455#else
    456                         out1fmt("%ld\n", (long) val);
     456                        out1fmt(psh, "%ld\n", (long) val);
    457457#endif
    458458                }
Note: See TracChangeset for help on using the changeset viewer.