r8425: add err() and errx() functions needed by for compile_et on some systems
authorAndrew Tridgell <tridge@samba.org>
Wed, 13 Jul 2005 13:55:06 +0000 (13:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:23:01 +0000 (13:23 -0500)
(This used to be commit 72a769b6d1a1ce5f8a19010074960b692b4755db)

source4/extra_cflags.txt
source4/heimdal_build/config.m4
source4/heimdal_build/config.mk
source4/heimdal_build/glue.c
source4/heimdal_build/replace.c [new file with mode: 0644]

index 0a8495e115a22125f086a2c7bf7c6463397fc525..6ecb170aa53e7d189dc85cac8c1caef39e52ff49 100644 (file)
@@ -1 +1,2 @@
 heimdal -Iheimdal_build -Iheimdal/kdc -Iheimdal/lib/des -Iheimdal/lib/roken -Iheimdal/include -DNO_PRINTF_ATTRIBUTE
+heimdal_build/replace.o -Iheimdal_build -Iheimdal/lib/roken
index 4e521e4cfdaa7b694420d01e2a66ec17b16726d3..43688257830f92598423cd4afd7f8e0fce948c1f 100644 (file)
@@ -85,6 +85,8 @@ AC_CHECK_FUNCS([                              \
        unsetenv                                \
        closefrom                               \
        hstrerror                               \
+       err                                     \
+       errx                                    \
        writev
 ])
 
index 572e918b9644e2e9b79b9a301049191c82942d28..49da7f10d275a9d037647907fe6fedd75965bf95 100644 (file)
@@ -326,7 +326,8 @@ ADD_OBJ_FILES = \
        heimdal/lib/roken/strupr.o \
        heimdal/lib/roken/getprogname.o \
        heimdal/lib/roken/get_window_size.o \
-       heimdal/lib/asn1/symbol.o
+       heimdal/lib/asn1/symbol.o \
+       heimdal_build/replace.o
 NOPROTO = YES
 # End SUBSYSTEM ASN1_COMPILER
 #######################
@@ -351,7 +352,8 @@ ADD_OBJ_FILES = \
        heimdal/lib/roken/getprogname.o \
        heimdal/lib/roken/strupr.o \
        heimdal/lib/roken/print_version.o \
-       heimdal/lib/roken/setprogname.o
+       heimdal/lib/roken/setprogname.o \
+       heimdal_build/replace.o
 NOPROTO = YES
 # End SUBSYSTEM COMPILE_ET
 #######################
index 106a733a942250c775c860627daaaa2a57a923ba..d3ac8ee5b20858c44f0da528cc962cf75b1f44f7 100644 (file)
@@ -23,6 +23,7 @@
 #include "includes.h"
 #include "system/network.h"
 #include "system/kerberos.h"
+#include "err.h"
 
 /*
   get the list of IP addresses for configured interfaces
@@ -48,3 +49,12 @@ krb5_error_code krb5_get_all_client_addrs(krb5_context context, krb5_addresses *
 
        return 0;
 }
+
+
+void errx(int eval, const char *fmt, ...)
+{
+  va_list ap;
+  va_start(ap, fmt);
+  verrx(eval, fmt, ap);
+  va_end(ap);
+}
diff --git a/source4/heimdal_build/replace.c b/source4/heimdal_build/replace.c
new file mode 100644 (file)
index 0000000..0b7e194
--- /dev/null
@@ -0,0 +1,49 @@
+/* 
+   Unix SMB/CIFS implementation.
+
+   some replacement functions for parts of roken that don't fit easily into 
+   our build system
+
+   Copyright (C) Andrew Tridgell 2005
+   
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#include "config.h"
+#include <stdio.h>
+#include "err.h"
+
+#ifndef HAVE_ERR
+ void err(int eval, const char *format, ...)
+{
+       va_list ap;
+       va_start(ap, format);
+       vfprintf(stderr, format, ap);
+       perror("");
+       va_end(ap);
+       exit(eval);
+}
+#endif
+
+#ifndef HAVE_ERRX
+ void errx(int eval, const char *format, ...)
+{
+       va_list ap;
+       va_start(ap, format);
+       vfprintf(stderr, format, ap);
+       va_end(ap);
+       exit(eval);
+}
+#endif