(closes issue #10692)

Reported by: snuffy
Patches:
      minivm.diff uploaded by snuffy (license 35)
Instead of using err (which is not available under Solaris) use fdprintf with stderr.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Joshua Colp 18 years ago
parent c121ed6bec
commit a7d3a24fa5

@ -38,7 +38,6 @@
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <getopt.h> #include <getopt.h>
#include <err.h>
#include "mm.h" #include "mm.h"
@ -106,20 +105,20 @@ main(int argc, char **argv)
i = mm_parse_file(ctx, argv[0], MM_PARSE_LOOSE, 0); i = mm_parse_file(ctx, argv[0], MM_PARSE_LOOSE, 0);
} else { } else {
if (stat(argv[0], &st) == -1) { if (stat(argv[0], &st) == -1) {
err(1, "stat"); fprintf(stderr, "INFO: stat");
} }
if ((fd = open(argv[0], O_RDONLY)) == -1) { if ((fd = open(argv[0], O_RDONLY)) == -1) {
err(1, "open"); fdprintf(stderr, "INFO: open");
} }
buf = (char *)malloc(st.st_size); buf = (char *)malloc(st.st_size);
if (buf == NULL) { if (buf == NULL) {
err(1, "malloc"); fdprintf(stderr, "INFO: malloc");
} }
if (read(fd, buf, st.st_size) != st.st_size) { if (read(fd, buf, st.st_size) != st.st_size) {
err(1, "read"); fdprintf(stderr, "INFO: read");
} }
close(fd); close(fd);

@ -37,7 +37,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include <err.h>
#include <assert.h> #include <assert.h>
#include "mm_internal.h" #include "mm_internal.h"
@ -55,11 +54,11 @@ MM_malloc(size_t size, char *filename, int line)
pointer = malloc(size); pointer = malloc(size);
if (pointer == NULL) if (pointer == NULL)
err(1, "malloc"); fdprintf(stderr, "INFO: malloc");
chunk = (struct MM_mem_chunk *)malloc(sizeof(struct MM_mem_chunk)); chunk = (struct MM_mem_chunk *)malloc(sizeof(struct MM_mem_chunk));
if (chunk == NULL) if (chunk == NULL)
err(1, "malloc"); fdprintf(stderr, "INFO: malloc");
chunk->address = pointer; chunk->address = pointer;
chunk->size = size; chunk->size = size;

@ -40,7 +40,6 @@
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <getopt.h> #include <getopt.h>
#include <err.h>
#include "mm.h" #include "mm.h"

@ -40,7 +40,6 @@
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <getopt.h> #include <getopt.h>
#include <err.h>
#include "mm.h" #include "mm.h"

Loading…
Cancel
Save