Ignore:
Timestamp:
Oct 7, 2007, 10:39:58 PM (18 years ago)
Author:
bird
Message:

some more cleanup.

File:
1 edited

Legend:

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

    r1207 r1214  
    3333 */
    3434
    35 #ifdef HAVE_SYS_CDEFS_H
    36 #include <sys/cdefs.h>
    37 #endif
     35#if 0
    3836#ifndef lint
    39 #if 0
    4037static char sccsid[] = "@(#)miscbltin.c 8.4 (Berkeley) 5/4/95";
    4138#else
    4239__RCSID("$NetBSD: miscbltin.c,v 1.35 2005/03/19 14:22:50 dsl Exp $");
    43 #endif
    4440#endif /* not lint */
     41#endif
    4542
    4643/*
     
    4946
    5047#include <sys/types.h>
    51 #include <sys/stat.h>
    52 #include <sys/time.h>
    53 #include <sys/resource.h>
    54 #include <unistd.h>
    5548#include <stdlib.h>
    5649#include <ctype.h>
    5750#include <errno.h>
    58 #ifndef _MSC_VER
    59 # include "mscfakes.h"
    60 #endif
    6151
    6252#include "shell.h"
     
    6858#include "miscbltin.h"
    6959#include "mystring.h"
     60#include "shinstance.h"
    7061
    7162#undef rflag
     
    359350{
    360351        int     c;
    361         rlim_t val = 0;
     352        shrlim_t val = 0;
    362353        enum { SOFT = 0x1, HARD = 0x2 }
    363354                        how = SOFT | HARD;
     
    365356        int             set, all = 0;
    366357        int             optc, what;
    367         struct rlimit   limit;
     358        shrlimit        limit;
    368359
    369360        what = 'f';
     
    397388                        val = RLIM_INFINITY;
    398389                else {
    399                         val = (rlim_t) 0;
     390                        val = (shrlim_t) 0;
    400391
    401392                        while ((c = *p++) >= '0' && c <= '9')
    402393                        {
    403394                                val = (val * 10) + (long)(c - '0');
    404                                 if (val < (rlim_t) 0)
     395                                if (val < (shrlim_t) 0)
    405396                                        break;
    406397                        }
     
    412403        if (all) {
    413404                for (l = limits; l->name; l++) {
    414                         getrlimit(l->cmd, &limit);
     405                        sh_getrlimit(psh, l->cmd, &limit);
    415406                        if (how & SOFT)
    416407                                val = limit.rlim_cur;
     
    430421        }
    431422
    432         getrlimit(l->cmd, &limit);
     423        sh_getrlimit(psh, l->cmd, &limit);
    433424        if (set) {
    434425                if (how & HARD)
     
    436427                if (how & SOFT)
    437428                        limit.rlim_cur = val;
    438                 if (setrlimit(l->cmd, &limit) < 0)
     429                if (sh_setrlimit(psh, l->cmd, &limit) < 0)
    439430                        error(psh, "error setting limit (%s)", strerror(errno));
    440431        } else {
Note: See TracChangeset for help on using the changeset viewer.