diff options
author | rsc <devnull@localhost> | 2005-02-08 21:02:54 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2005-02-08 21:02:54 +0000 |
commit | b1cd1d55e1418f2ed8236d488f815d0108b99598 (patch) | |
tree | ea7121bbd6a0cba8990246586896f1a6fd7794d8 /src/lib9p | |
parent | 641405320f4601f50e0d728805e14fb6f8196710 (diff) | |
download | plan9port-b1cd1d55e1418f2ed8236d488f815d0108b99598.tar.gz plan9port-b1cd1d55e1418f2ed8236d488f815d0108b99598.tar.bz2 plan9port-b1cd1d55e1418f2ed8236d488f815d0108b99598.zip |
use sysfatal
Diffstat (limited to 'src/lib9p')
-rw-r--r-- | src/lib9p/mem.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/src/lib9p/mem.c b/src/lib9p/mem.c index b4414951..c44f506d 100644 --- a/src/lib9p/mem.c +++ b/src/lib9p/mem.c @@ -10,10 +10,8 @@ emalloc9p(ulong sz) { void *v; - if((v = malloc(sz)) == nil) { - fprint(2, "out of memory allocating %lud\n", sz); - exits("mem"); - } + if((v = malloc(sz)) == nil) + sysfatal("out of memory allocating %lud", sz); memset(v, 0, sz); setmalloctag(v, getcallerpc(&sz)); return v; @@ -24,10 +22,8 @@ erealloc9p(void *v, ulong sz) { void *nv; - if((nv = realloc(v, sz)) == nil) { - fprint(2, "out of memory allocating %lud\n", sz); - exits("mem"); - } + if((nv = realloc(v, sz)) == nil) + sysfatal("out of memory reallocating %lud", sz); if(v == nil) setmalloctag(nv, getcallerpc(&v)); setrealloctag(nv, getcallerpc(&v)); @@ -39,10 +35,8 @@ estrdup9p(char *s) { char *t; - if((t = strdup(s)) == nil) { - fprint(2, "out of memory in strdup(%.10s)\n", s); - exits("mem"); - } + if((t = strdup(s)) == nil) + sysfatal("out of memory in strdup(%.20s)", s); setmalloctag(t, getcallerpc(&s)); return t; } |