aboutsummaryrefslogtreecommitdiff
path: root/assert/assert.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-08-11 09:25:47 +0000
committerUlrich Drepper <drepper@redhat.com>2001-08-11 09:25:47 +0000
commit541587c87986ed163d8eb60040149f5fac05e6d3 (patch)
treee7806aedd1e331cbd0af9b6ffa976496d616ba0f /assert/assert.c
parent67c94753e3f2ec372483cd41fbcc1bcdc04053fb (diff)
downloadglibc-541587c87986ed163d8eb60040149f5fac05e6d3.zip
glibc-541587c87986ed163d8eb60040149f5fac05e6d3.tar.gz
glibc-541587c87986ed163d8eb60040149f5fac05e6d3.tar.bz2
Update.
* assert/assert.c (set_progname): Removed. (__assert_fail): Use __progname instead of __assert_program_name. * assert/assert-perr.c (__assert_perror_fail): Likewise.
Diffstat (limited to 'assert/assert.c')
-rw-r--r--assert/assert.c32
1 files changed, 3 insertions, 29 deletions
diff --git a/assert/assert.c b/assert/assert.c
index 0db8795..81ad080 100644
--- a/assert/assert.c
+++ b/assert/assert.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 1994, 1995, 1996, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1994,1995,1996,1998,2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -23,7 +23,7 @@
#include <libintl.h>
-const char *__assert_program_name;
+extern const char *__progname;
#ifdef USE_IN_LIBIO
# include <libio/iolibio.h>
@@ -50,8 +50,7 @@ __assert_fail (const char *assertion, const char *file, unsigned int line,
/* Print the message. */
(void) fprintf (stderr, _("%s%s%s:%u: %s%sAssertion `%s' failed.\n"),
- __assert_program_name ? __assert_program_name : "",
- __assert_program_name ? ": " : "",
+ __progname, __progname[0] ? ": " : "",
file, line,
function ? function : "", function ? ": " : "",
assertion);
@@ -59,28 +58,3 @@ __assert_fail (const char *assertion, const char *file, unsigned int line,
abort ();
}
-
-#ifdef HAVE_GNU_LD
-
-#include <string.h>
-
-static void
-set_progname (int argc, char **argv, char **envp)
-{
- char *p;
-
- if (argv && argv[0])
- {
- p = strrchr (argv[0], '/');
- if (p == NULL)
- __assert_program_name = argv[0];
- else
- __assert_program_name = p + 1;
- }
-
- (void) &set_progname; /* Avoid "defined but not used" warning. */
-}
-
-text_set_element (__libc_subinit, set_progname);
-
-#endif