diff --git a/usr.bin/m4/main.c b/usr.bin/m4/main.c index 95ca6618c0df..734d6d7b777e 100644 --- a/usr.bin/m4/main.c +++ b/usr.bin/m4/main.c @@ -1,5 +1,5 @@ /* $OpenBSD: main.c,v 1.77 2009/10/14 17:19:47 sthen Exp $ */ -/* $NetBSD: main.c,v 1.38 2009/10/26 21:11:28 christos Exp $ */ +/* $NetBSD: main.c,v 1.39 2009/11/06 15:13:27 joerg Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -42,7 +42,7 @@ #include "nbtool_config.h" #endif #include -__RCSID("$NetBSD: main.c,v 1.38 2009/10/26 21:11:28 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.39 2009/11/06 15:13:27 joerg Exp $"); #include #include #include @@ -176,6 +176,8 @@ main(int argc, char *argv[]) int n; char *p; + setprogname(argv[0]); + if (signal(SIGINT, SIG_IGN) != SIG_IGN) signal(SIGINT, onintr); diff --git a/usr.bin/m4/misc.c b/usr.bin/m4/misc.c index f3d727b41920..d06b27578963 100644 --- a/usr.bin/m4/misc.c +++ b/usr.bin/m4/misc.c @@ -1,5 +1,5 @@ /* $OpenBSD: misc.c,v 1.41 2009/10/14 17:19:47 sthen Exp $ */ -/* $NetBSD: misc.c,v 1.19 2009/10/26 21:11:28 christos Exp $ */ +/* $NetBSD: misc.c,v 1.20 2009/11/06 15:13:27 joerg Exp $ */ /* * Copyright (c) 1989, 1993 @@ -36,7 +36,7 @@ #include "nbtool_config.h" #endif #include -__RCSID("$NetBSD: misc.c,v 1.19 2009/10/26 21:11:28 christos Exp $"); +__RCSID("$NetBSD: misc.c,v 1.20 2009/11/06 15:13:27 joerg Exp $"); #include #include #include @@ -262,12 +262,10 @@ killdiv() } } -extern char *__progname; - void m4errx(int exval, const char *fmt, ...) { - fprintf(stderr, "%s: ", __progname); + fprintf(stderr, "%s: ", getprogname()); fprintf(stderr, "%s at line %lu: ", CURRENT_NAME, CURRENT_LINE); if (fmt != NULL) { va_list ap;