fix error messages
This commit is contained in:
parent
7d718eded8
commit
5521b51a7a
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: yperr_string.c,v 1.8 2012/06/25 22:32:46 abs Exp $ */
|
||||
/* $NetBSD: yperr_string.c,v 1.9 2015/06/17 00:15:26 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@fsa.ca>
|
||||
@ -28,7 +28,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if defined(LIBC_SCCS) && !defined(lint)
|
||||
__RCSID("$NetBSD: yperr_string.c,v 1.8 2012/06/25 22:32:46 abs Exp $");
|
||||
__RCSID("$NetBSD: yperr_string.c,v 1.9 2015/06/17 00:15:26 christos Exp $");
|
||||
#endif
|
||||
|
||||
#include "namespace.h"
|
||||
@ -85,6 +85,6 @@ yperr_string(int incode)
|
||||
case YPERR_BUSY:
|
||||
return __UNCONST("Database is busy");
|
||||
}
|
||||
(void) snprintf(err, sizeof(err), "YP unknown error %d\n", incode);
|
||||
(void) snprintf(err, sizeof(err), "YP unknown error %d", incode);
|
||||
return err;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: crypt.c,v 1.33 2011/12/28 03:13:09 christos Exp $ */
|
||||
/* $NetBSD: crypt.c,v 1.34 2015/06/17 00:15:26 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
@ -37,7 +37,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)crypt.c 8.1.1.1 (Berkeley) 8/18/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: crypt.c,v 1.33 2011/12/28 03:13:09 christos Exp $");
|
||||
__RCSID("$NetBSD: crypt.c,v 1.34 2015/06/17 00:15:26 christos Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -1013,10 +1013,12 @@ prtab(const char *s, unsigned char *t, int num_rows)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
errx(1, "Usage: %s password [salt]\n", argv[0]);
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "Usage: %s password [salt]\n", getprogname());
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
printf("%s\n", crypt(argv[1], (argc > 2) ? argv[2] : argv[1]));
|
||||
exit(0);
|
||||
printf("%s\n", crypt(argv[1], (argc > 2) ? argv[2] : argv[1]));
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: puffs.c,v 1.119 2014/12/22 08:16:21 manu Exp $ */
|
||||
/* $NetBSD: puffs.c,v 1.120 2015/06/17 00:15:26 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2005, 2006, 2007 Antti Kantee. All Rights Reserved.
|
||||
@ -31,7 +31,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#if !defined(lint)
|
||||
__RCSID("$NetBSD: puffs.c,v 1.119 2014/12/22 08:16:21 manu Exp $");
|
||||
__RCSID("$NetBSD: puffs.c,v 1.120 2015/06/17 00:15:26 christos Exp $");
|
||||
#endif /* !lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -134,7 +134,7 @@ puffs_kernerr_abort(struct puffs_usermount *pu, uint8_t type,
|
||||
int error, const char *str, puffs_cookie_t cookie)
|
||||
{
|
||||
|
||||
fprintf(stderr, "abort: type %d, error %d, cookie %p (%s)\n",
|
||||
warnx("abort: type %d, error %d, cookie %p (%s)",
|
||||
type, error, cookie, str);
|
||||
abort();
|
||||
}
|
||||
@ -145,7 +145,7 @@ puffs_kernerr_log(struct puffs_usermount *pu, uint8_t type,
|
||||
int error, const char *str, puffs_cookie_t cookie)
|
||||
{
|
||||
|
||||
syslog(LOG_WARNING, "kernel: type %d, error %d, cookie %p (%s)\n",
|
||||
syslog(LOG_WARNING, "kernel: type %d, error %d, cookie %p (%s)",
|
||||
type, error, cookie, str);
|
||||
}
|
||||
|
||||
@ -213,8 +213,8 @@ puffs_setstacksize(struct puffs_usermount *pu, size_t ss)
|
||||
minsize = 4*psize;
|
||||
if (ss < (size_t)minsize || ss == PUFFS_STACKSIZE_MIN) {
|
||||
if (ss != PUFFS_STACKSIZE_MIN)
|
||||
fprintf(stderr, "puffs_setstacksize: adjusting "
|
||||
"stacksize to minimum %ld\n", minsize);
|
||||
warnx("%s: adjusting " "stacksize to minimum %ld",
|
||||
__func__, minsize);
|
||||
ss = 4*psize;
|
||||
}
|
||||
|
||||
@ -228,8 +228,8 @@ puffs_setstacksize(struct puffs_usermount *pu, size_t ss)
|
||||
}
|
||||
if (bonus > 1) {
|
||||
stackshift++;
|
||||
fprintf(stderr, "puffs_setstacksize: using next power of two: "
|
||||
"%d\n", 1<<stackshift);
|
||||
warnx("%s: using next power of two: %d", __func__,
|
||||
1 << stackshift);
|
||||
}
|
||||
|
||||
pu->pu_cc_stackshift = stackshift;
|
||||
@ -270,8 +270,7 @@ puffs_setrootinfo(struct puffs_usermount *pu, enum vtype vt,
|
||||
struct puffs_kargs *pargs = pu->pu_kargp;
|
||||
|
||||
if (puffs_getstate(pu) != PUFFS_STATE_BEFOREMOUNT) {
|
||||
warnx("puffs_setrootinfo: call has effect only "
|
||||
"before mount\n");
|
||||
warnx("%s: call has effect only before mount", __func__);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -318,8 +317,7 @@ puffs_setmaxreqlen(struct puffs_usermount *pu, size_t reqlen)
|
||||
{
|
||||
|
||||
if (puffs_getstate(pu) != PUFFS_STATE_BEFOREMOUNT)
|
||||
warnx("puffs_setmaxreqlen: call has effect only "
|
||||
"before mount\n");
|
||||
warnx("%s: call has effect only before mount", __func__);
|
||||
|
||||
pu->pu_kargp->pa_maxmsglen = reqlen;
|
||||
}
|
||||
@ -329,7 +327,7 @@ puffs_setfhsize(struct puffs_usermount *pu, size_t fhsize, int flags)
|
||||
{
|
||||
|
||||
if (puffs_getstate(pu) != PUFFS_STATE_BEFOREMOUNT)
|
||||
warnx("puffs_setfhsize: call has effect only before mount\n");
|
||||
warnx("%s: call has effect only before mount", __func__);
|
||||
|
||||
pu->pu_kargp->pa_fhsize = fhsize;
|
||||
pu->pu_kargp->pa_fhflags = flags;
|
||||
@ -340,7 +338,7 @@ puffs_setncookiehash(struct puffs_usermount *pu, int nhash)
|
||||
{
|
||||
|
||||
if (puffs_getstate(pu) != PUFFS_STATE_BEFOREMOUNT)
|
||||
warnx("puffs_setfhsize: call has effect only before mount\n");
|
||||
warnx("%s: call has effect only before mount", __func__);
|
||||
|
||||
pu->pu_kargp->pa_nhashbuckets = nhash;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ukfs.c,v 1.57 2011/02/22 15:42:15 pooka Exp $ */
|
||||
/* $NetBSD: ukfs.c,v 1.58 2015/06/17 00:15:26 christos Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007, 2008, 2009 Antti Kantee. All Rights Reserved.
|
||||
@ -182,9 +182,9 @@ _ukfs_init(int version)
|
||||
int rv;
|
||||
|
||||
if (version != UKFS_VERSION) {
|
||||
printf("incompatible ukfs version, %d vs. %d\n",
|
||||
version, UKFS_VERSION);
|
||||
errno = EPROGMISMATCH;
|
||||
warn("incompatible ukfs version, %d vs. %d",
|
||||
version, UKFS_VERSION);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -213,8 +213,8 @@ ukfs_part_probe(char *devpath, struct ukfs_part **partp)
|
||||
int devfd = -1;
|
||||
|
||||
if ((p = strstr(devpath, UKFS_PARTITION_SCANMAGIC)) != NULL) {
|
||||
fprintf(stderr, "ukfs: %%PART is deprecated. use "
|
||||
"%%DISKLABEL instead\n");
|
||||
warnx("ukfs: %%PART is deprecated. use "
|
||||
"%%DISKLABEL instead");
|
||||
errno = ENODEV;
|
||||
return -1;
|
||||
}
|
||||
@ -1152,7 +1152,7 @@ ukfs_modload(const char *fname)
|
||||
const char *dlmsg = dlerror();
|
||||
if (strstr(dlmsg, "Undefined symbol"))
|
||||
return 0;
|
||||
warnx("dlopen %s failed: %s\n", fname, dlmsg);
|
||||
warnx("dlopen %s failed: %s", fname, dlmsg);
|
||||
/* XXXerrno */
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user