]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
(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 f96b62fb11763a8139c068fc57ec68d13beeeb67..1b324585ce8abffcb3eb3aaba2e2fc70c65aafd7 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 91ad3b987f4a4fc8be8344b81206002799f35bed..6c915e56497c6c0ec80a41bfbdef71f247e7aae4 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 a8ca479f14aec65b431239988dade41d18832c80..c881f17f78517753b8fde34813e79843ce899757 100644 (file)
@@ -40,7 +40,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <getopt.h>
-#include <err.h>
 
 #include "mm.h"
 
index 805bd2cb18a19685f000a4207a4a1a38caf40275..3d3bdf0284af8ef65c7f583c8e083f1a4407f47c 100644 (file)
@@ -40,7 +40,6 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <getopt.h>
-#include <err.h>
 
 #include "mm.h"