Ignore:
Timestamp:
Jan 19, 2010, 1:44:23 PM (10 years ago)
Author:
Sam Hocevar
Message:

Fix memory limitation method on OS X (page size was ignored) and other
systems (was using MBs instead of MiBs?).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • zzuf/trunk/src/zzuf.c

    r4277 r4282  
    291291#if defined HAVE_SETRLIMIT && defined ZZUF_RLIMIT_MEM
    292292        case 'M': /* --max-memory */
    293             setenv("ZZUF_MEMORY", "1", 1);
    294293            if(myoptarg[0] == '=')
    295294                myoptarg++;
     
    458457    if(opts->refuse)
    459458        setenv("ZZUF_REFUSE", opts->refuse, 1);
     459#if defined HAVE_SETRLIMIT && defined ZZUF_RLIMIT_MEM
     460    if(opts->maxmem >= 0)
     461    {
     462        char buf[32];
     463        snprintf(buf, 32, "%i", opts->maxmem);
     464        setenv("ZZUF_MEMORY", buf, 1);
     465    }
     466#endif
    460467
    461468    /* Allocate memory for children handling */
Note: See TracChangeset for help on using the changeset viewer.