(closes issue #10692)
authorJoshua Colp <jcolp@digium.com>
Tue, 11 Sep 2007 13:10:04 +0000 (13:10 +0000)
committerJoshua Colp <jcolp@digium.com>
Tue, 11 Sep 2007 13:10:04 +0000 (13:10 +0000)
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

main/minimime/minimime.c
main/minimime/mm_mem.c
main/minimime/tests/create.c
main/minimime/tests/parse.c

index f96b62f..1b32458 100644 (file)
@@ -38,7 +38,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <getopt.h>
-#include <err.h>
 
 #include "mm.h"
 
@@ -106,20 +105,20 @@ main(int argc, char **argv)
                        i = mm_parse_file(ctx, argv[0], MM_PARSE_LOOSE, 0);
                } else {
                        if (stat(argv[0], &st) == -1) {
-                               err(1, "stat");
+                               fprintf(stderr, "INFO: stat");
                        }
        
                        if ((fd = open(argv[0], O_RDONLY)) == -1) {
-                               err(1, "open");
+                               fdprintf(stderr, "INFO: open");
                        }
 
                        buf = (char *)malloc(st.st_size);
                        if (buf == NULL) {
-                               err(1, "malloc");
+                               fdprintf(stderr, "INFO: malloc");
                        }       
 
                        if (read(fd, buf, st.st_size) != st.st_size) {
-                               err(1, "read");
+                               fdprintf(stderr, "INFO: read");
                        }
 
                        close(fd);
index 91ad3b9..6c915e5 100644 (file)
@@ -37,7 +37,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#include <err.h>
 #include <assert.h>
 
 #include "mm_internal.h"
@@ -55,11 +54,11 @@ MM_malloc(size_t size, char *filename, int line)
 
        pointer = malloc(size);
        if (pointer == NULL)
-               err(1, "malloc");
+               fdprintf(stderr, "INFO: malloc");
 
        chunk = (struct MM_mem_chunk *)malloc(sizeof(struct MM_mem_chunk));
        if (chunk == NULL)
-               err(1, "malloc");
+               fdprintf(stderr, "INFO: malloc");
 
        chunk->address = pointer;
        chunk->size = size;
index a8ca479..c881f17 100644 (file)
@@ -40,7 +40,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <getopt.h>
-#include <err.h>
 
 #include "mm.h"
 
index 805bd2c..3d3bdf0 100644 (file)
@@ -40,7 +40,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <getopt.h>
-#include <err.h>
 
 #include "mm.h"