Sprinkle __func__ in appropriate error messages.

This commit is contained in:
okan 2016-10-24 17:39:38 +00:00
parent 66d541d7ee
commit 6eaec44a4a
5 changed files with 15 additions and 15 deletions

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: conf.c,v 1.217 2016/10/18 17:03:30 okan Exp $
* $OpenBSD: conf.c,v 1.218 2016/10/24 17:39:38 okan Exp $
*/
#include <sys/types.h>
@ -138,7 +138,7 @@ conf_screen(struct screen_ctx *sc)
if (sc->xftfont == NULL) {
sc->xftfont = XftFontOpenName(X_Dpy, sc->which, Conf.font);
if (sc->xftfont == NULL)
errx(1, "XftFontOpenName: %s", Conf.font);
errx(1, "%s: XftFontOpenName: %s", __func__, Conf.font);
}
for (i = 0; i < nitems(color_binds); i++) {
@ -169,7 +169,7 @@ conf_screen(struct screen_ctx *sc)
sc->menu.xftdraw = XftDrawCreate(X_Dpy, sc->menu.win, visual, colormap);
if (sc->menu.xftdraw == NULL)
errx(1, "XftDrawCreate");
errx(1, "%s: XftDrawCreate", __func__);
conf_grab_kbd(sc->rootwin);
}

View File

@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: group.c,v 1.124 2016/10/18 17:03:30 okan Exp $
* $OpenBSD: group.c,v 1.125 2016/10/24 17:39:38 okan Exp $
*/
#include <sys/types.h>
@ -155,7 +155,7 @@ group_movetogroup(struct client_ctx *cc, int idx)
struct group_ctx *gc;
if (idx < 0 || idx >= Conf.ngroups)
errx(1, "group_movetogroup: index out of range (%d)", idx);
errx(1, "%s: index out of range (%d)", __func__, idx);
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)
@ -223,7 +223,7 @@ group_hidetoggle(struct screen_ctx *sc, int idx)
struct group_ctx *gc;
if (idx < 0 || idx >= Conf.ngroups)
errx(1, "group_hidetoggle: index out of range (%d)", idx);
errx(1, "%s: index out of range (%d)", __func__, idx);
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)
@ -246,7 +246,7 @@ group_only(struct screen_ctx *sc, int idx)
struct group_ctx *gc;
if (idx < 0 || idx >= Conf.ngroups)
errx(1, "group_only: index out of range (%d)", idx);
errx(1, "%s: index out of range (%d)", __func__, idx);
TAILQ_FOREACH(gc, &sc->groupq, entry) {
if (gc->num == idx)

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: kbfunc.c,v 1.132 2016/10/18 17:03:30 okan Exp $
* $OpenBSD: kbfunc.c,v 1.133 2016/10/24 17:39:38 okan Exp $
*/
#include <sys/types.h>
@ -405,7 +405,7 @@ kbfunc_menu_exec(void *ctx, union arg *arg, enum xev xev)
label = "wm";
break;
default:
errx(1, "kbfunc_menu_exec: invalid cmd %d", cmd);
errx(1, "%s: invalid cmd %d", __func__, cmd);
/* NOTREACHED */
}
@ -456,7 +456,7 @@ kbfunc_menu_exec(void *ctx, union arg *arg, enum xev xev)
Conf.wm_argv = xstrdup(mi->text);
break;
default:
errx(1, "kb_func: egad, cmd changed value!");
errx(1, "%s: egad, cmd changed value!", __func__);
/* NOTREACHED */
}
}
@ -487,7 +487,7 @@ kbfunc_menu_ssh(void *ctx, union arg *arg, enum xev xev)
TAILQ_INIT(&menuq);
if ((fp = fopen(Conf.known_hosts, "r")) == NULL) {
warn("kbfunc_menu_ssh: %s", Conf.known_hosts);
warn("%s: %s", __func__, Conf.known_hosts);
goto menu;
}

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: screen.c,v 1.83 2016/10/18 17:03:30 okan Exp $
* $OpenBSD: screen.c,v 1.84 2016/10/24 17:39:38 okan Exp $
*/
#include <sys/types.h>
@ -101,7 +101,7 @@ screen_find(Window win)
if (sc->rootwin == win)
return(sc);
}
warnx("screen_find failure win 0x%lu\n", win);
warnx("%s: failure win 0x%lu\n", __func__, win);
return(NULL);
}

View File

@ -15,7 +15,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* $OpenBSD: search.c,v 1.55 2016/10/24 17:16:23 okan Exp $
* $OpenBSD: search.c,v 1.56 2016/10/24 17:39:38 okan Exp $
*/
#include <sys/types.h>
@ -85,7 +85,7 @@ search_match_client(struct menu_q *menuq, struct menu_q *resultq, char *search)
tier--;
if (tier >= nitems(tierp))
errx(1, "search_match_client: invalid tier");
errx(1, "%s: invalid tier", __func__);
/*
* If you have a tierp, insert after it, and make it