diff options
author | tedu <> | 2016-01-06 17:57:22 +0000 |
---|---|---|
committer | tedu <> | 2016-01-06 17:57:22 +0000 |
commit | 9fab5fb01ddbd59e5aa97edb223fd1e132231682 (patch) | |
tree | 9e720cdb3ef90683db00bae19fd31300ed7ccf16 /src/lib/libc/stdlib/malloc.c | |
parent | c0c3491a8e39b8f754d5d210441e118a58201189 (diff) | |
download | openbsd-9fab5fb01ddbd59e5aa97edb223fd1e132231682.tar.gz openbsd-9fab5fb01ddbd59e5aa97edb223fd1e132231682.tar.bz2 openbsd-9fab5fb01ddbd59e5aa97edb223fd1e132231682.zip |
Long ago, malloc internally had two kinds of failures, warnings and errors.
The 'A' option elevated warnings to errors, and has been the default for some
time. Then warnings were effectively eliminated in favor of everything
being an error, but then the 'a' flag turned real errors into warnings!
Remove the 'a' option entirely. You shouldn't have used it anyway.
ok tb tdeval
Diffstat (limited to 'src/lib/libc/stdlib/malloc.c')
-rw-r--r-- | src/lib/libc/stdlib/malloc.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index 7d64be89a9..23e076bdaf 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: malloc.c,v 1.179 2015/12/30 06:04:39 tedu Exp $ */ | 1 | /* $OpenBSD: malloc.c,v 1.180 2016/01/06 17:57:22 tedu Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net> | 3 | * Copyright (c) 2008, 2010, 2011 Otto Moerbeek <otto@drijf.net> |
4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> | 4 | * Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org> |
@@ -177,7 +177,6 @@ struct chunk_info { | |||
177 | 177 | ||
178 | struct malloc_readonly { | 178 | struct malloc_readonly { |
179 | struct dir_info *malloc_pool; /* Main bookkeeping information */ | 179 | struct dir_info *malloc_pool; /* Main bookkeeping information */ |
180 | int malloc_abort; /* abort() on error */ | ||
181 | int malloc_freenow; /* Free quickly - disable chunk rnd */ | 180 | int malloc_freenow; /* Free quickly - disable chunk rnd */ |
182 | int malloc_freeunmap; /* mprotect free pages PROT_NONE? */ | 181 | int malloc_freeunmap; /* mprotect free pages PROT_NONE? */ |
183 | int malloc_hint; /* call madvice on free pages? */ | 182 | int malloc_hint; /* call madvice on free pages? */ |
@@ -280,8 +279,8 @@ wrterror(char *msg, void *p) | |||
280 | #endif /* MALLOC_STATS */ | 279 | #endif /* MALLOC_STATS */ |
281 | 280 | ||
282 | errno = saved_errno; | 281 | errno = saved_errno; |
283 | if (mopts.malloc_abort) | 282 | |
284 | abort(); | 283 | abort(); |
285 | } | 284 | } |
286 | 285 | ||
287 | static void | 286 | static void |
@@ -485,7 +484,6 @@ omalloc_init(struct dir_info **dp) | |||
485 | /* | 484 | /* |
486 | * Default options | 485 | * Default options |
487 | */ | 486 | */ |
488 | mopts.malloc_abort = 1; | ||
489 | mopts.malloc_junk = 1; | 487 | mopts.malloc_junk = 1; |
490 | mopts.malloc_move = 1; | 488 | mopts.malloc_move = 1; |
491 | mopts.malloc_cache = MALLOC_DEFAULT_CACHE; | 489 | mopts.malloc_cache = MALLOC_DEFAULT_CACHE; |
@@ -523,10 +521,8 @@ omalloc_init(struct dir_info **dp) | |||
523 | mopts.malloc_cache >>= 1; | 521 | mopts.malloc_cache >>= 1; |
524 | break; | 522 | break; |
525 | case 'a': | 523 | case 'a': |
526 | mopts.malloc_abort = 0; | ||
527 | break; | ||
528 | case 'A': | 524 | case 'A': |
529 | mopts.malloc_abort = 1; | 525 | /* ignored */ |
530 | break; | 526 | break; |
531 | case 'c': | 527 | case 'c': |
532 | mopts.malloc_canaries = 0; | 528 | mopts.malloc_canaries = 0; |