Replace __progname with the functionally identical but more

acceptable (documented) getprogname(3).
This commit is contained in:
Mark Murray 2002-03-24 15:06:48 +00:00
parent 55fad6bb0f
commit b813a7142b
2 changed files with 14 additions and 19 deletions

View File

@ -39,9 +39,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$FreeBSD$");
#endif /* not lint */
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/mount.h>
@ -52,6 +50,7 @@ __RCSID("$FreeBSD$");
#include <sys/disklabel.h>
#include <sys/ioctl.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <fstab.h>
@ -580,11 +579,10 @@ getfslab(const char *str)
static void
usage(void)
{
extern char *__progname;
static const char common[] =
"[-BFdpvlyn] [-T fstype:fsoptions] [-t fstype]";
(void)fprintf(stderr, "Usage: %s %s [special|node]...\n",
__progname, common);
getprogname(), common);
exit(1);
}

View File

@ -31,36 +31,33 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: fsutil.c,v 1.7 1998/07/30 17:41:03 thorpej Exp $");
#endif /* not lint */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <errno.h>
#include <fstab.h>
#include <err.h>
#include <paths.h>
__FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/stat.h>
#include <sys/mount.h>
#include <err.h>
#include <errno.h>
#include <fstab.h>
#include <paths.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "fsutil.h"
static const char *dev = NULL;
static int hot = 0;
static int preen = 0;
extern char *__progname;
static void vmsg(int, const char *, va_list) __printflike(2, 0);
void
@ -108,7 +105,7 @@ vmsg(int fatal, const char *fmt, va_list ap)
if (fatal && preen) {
(void) printf(
"%s: UNEXPECTED INCONSISTENCY; RUN %s MANUALLY.\n",
dev, __progname);
dev, getprogname());
exit(8);
}
}