Fix __progname mess.
This commit is contained in:
parent
3e36bb3dce
commit
98712b66ed
|
@ -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 <sys/cdefs.h>
|
||||
__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 <assert.h>
|
||||
#include <signal.h>
|
||||
#include <err.h>
|
||||
|
@ -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);
|
||||
|
||||
|
|
|
@ -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 <sys/cdefs.h>
|
||||
__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 <sys/types.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue