Sync OpenBSD patchset 332:

Regularise some fatal messages.
This commit is contained in:
Tiago Cunha 2009-09-20 22:11:27 +00:00
parent ab96772436
commit 3266fb5441
9 changed files with 25 additions and 25 deletions

View File

@ -1,4 +1,4 @@
/* $Id: client.c,v 1.70 2009-09-03 21:06:30 tcunha Exp $ */ /* $Id: client.c,v 1.71 2009-09-20 22:11:27 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -78,7 +78,7 @@ client_init(char *path, struct client_ctx *cctx, int cmdflags, int flags)
} }
if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1)
fatal("socket"); fatal("socket failed");
if (connect(fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) == -1) { if (connect(fd, (struct sockaddr *) &sa, SUN_LEN(&sa)) == -1) {
if (errno == ECONNREFUSED) { if (errno == ECONNREFUSED) {

View File

@ -1,4 +1,4 @@
/* $Id: names.c,v 1.15 2009-09-02 01:02:44 tcunha Exp $ */ /* $Id: names.c,v 1.16 2009-09-20 22:11:27 tcunha Exp $ */
/* /*
* Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net>
@ -36,7 +36,7 @@ set_window_names(void)
struct timeval tv, tv2; struct timeval tv, tv2;
if (gettimeofday(&tv, NULL) != 0) if (gettimeofday(&tv, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
for (i = 0; i < ARRAY_LENGTH(&windows); i++) { for (i = 0; i < ARRAY_LENGTH(&windows); i++) {
w = ARRAY_ITEM(&windows, i); w = ARRAY_ITEM(&windows, i);

View File

@ -1,4 +1,4 @@
/* $Id: paste.c,v 1.9 2009-09-07 23:48:54 tcunha Exp $ */ /* $Id: paste.c,v 1.10 2009-09-20 22:11:27 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -117,7 +117,7 @@ paste_add(struct paste_stack *ps, u_char *data, size_t size, u_int limit)
pb->data = data; pb->data = data;
pb->size = size; pb->size = size;
if (gettimeofday(&pb->tv, NULL) != 0) if (gettimeofday(&pb->tv, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
} }
int int
@ -134,7 +134,7 @@ paste_replace(struct paste_stack *ps, u_int idx, u_char *data, size_t size)
pb->data = data; pb->data = data;
pb->size = size; pb->size = size;
if (gettimeofday(&pb->tv, NULL) != 0) if (gettimeofday(&pb->tv, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
return (0); return (0);
} }

View File

@ -1,4 +1,4 @@
/* $Id: server-fn.c,v 1.87 2009-09-13 20:37:37 tcunha Exp $ */ /* $Id: server-fn.c,v 1.88 2009-09-20 22:11:27 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -321,7 +321,7 @@ server_set_identify(struct client *c)
tv.tv_usec = (delay % 1000) * 1000L; tv.tv_usec = (delay % 1000) * 1000L;
if (gettimeofday(&c->identify_timer, NULL) != 0) if (gettimeofday(&c->identify_timer, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
timeradd(&c->identify_timer, &tv, &c->identify_timer); timeradd(&c->identify_timer, &tv, &c->identify_timer);
c->flags |= CLIENT_IDENTIFY; c->flags |= CLIENT_IDENTIFY;

View File

@ -1,4 +1,4 @@
/* $Id: server.c,v 1.189 2009-09-19 18:53:01 tcunha Exp $ */ /* $Id: server.c,v 1.190 2009-09-20 22:11:27 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -438,7 +438,7 @@ server_child_signal(void)
case -1: case -1:
if (errno == ECHILD) if (errno == ECHILD)
return; return;
fatal("waitpid"); fatal("waitpid failed");
case 0: case 0:
return; return;
} }
@ -640,7 +640,7 @@ server_check_timers(struct client *c)
s = c->session; s = c->session;
if (gettimeofday(&tv, NULL) != 0) if (gettimeofday(&tv, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
if (c->flags & CLIENT_IDENTIFY && timercmp(&tv, &c->identify_timer, >)) if (c->flags & CLIENT_IDENTIFY && timercmp(&tv, &c->identify_timer, >))
server_clear_identify(c); server_clear_identify(c);
@ -808,7 +808,7 @@ server_handle_client(struct client *c)
xtimeout = options_get_number(&c->session->options, "repeat-time"); xtimeout = options_get_number(&c->session->options, "repeat-time");
if (xtimeout != 0 && c->flags & CLIENT_REPEAT) { if (xtimeout != 0 && c->flags & CLIENT_REPEAT) {
if (gettimeofday(&tv, NULL) != 0) if (gettimeofday(&tv, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
if (timercmp(&tv, &c->repeat_timer, >)) if (timercmp(&tv, &c->repeat_timer, >))
c->flags &= ~(CLIENT_PREFIX|CLIENT_REPEAT); c->flags &= ~(CLIENT_PREFIX|CLIENT_REPEAT);
} }
@ -892,7 +892,7 @@ server_handle_client(struct client *c)
tv.tv_sec = xtimeout / 1000; tv.tv_sec = xtimeout / 1000;
tv.tv_usec = (xtimeout % 1000) * 1000L; tv.tv_usec = (xtimeout % 1000) * 1000L;
if (gettimeofday(&c->repeat_timer, NULL) != 0) if (gettimeofday(&c->repeat_timer, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
timeradd(&c->repeat_timer, &tv, &c->repeat_timer); timeradd(&c->repeat_timer, &tv, &c->repeat_timer);
} }

View File

@ -1,4 +1,4 @@
/* $Id: session.c,v 1.66 2009-09-16 12:36:27 nicm Exp $ */ /* $Id: session.c,v 1.67 2009-09-20 22:11:27 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -125,7 +125,7 @@ session_create(const char *name, const char *cmd, const char *cwd,
s->flags = 0; s->flags = 0;
if (gettimeofday(&s->tv, NULL) != 0) if (gettimeofday(&s->tv, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
s->curw = NULL; s->curw = NULL;
SLIST_INIT(&s->lastw); SLIST_INIT(&s->lastw);

View File

@ -1,4 +1,4 @@
/* $Id: status.c,v 1.118 2009-09-11 14:13:52 tcunha Exp $ */ /* $Id: status.c,v 1.119 2009-09-20 22:11:27 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -64,7 +64,7 @@ status_redraw(struct client *c)
screen_init(&c->status, c->tty.sx, 1, 0); screen_init(&c->status, c->tty.sx, 1, 0);
if (gettimeofday(&c->status_timer, NULL) != 0) if (gettimeofday(&c->status_timer, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
memcpy(&stdgc, &grid_default_cell, sizeof gc); memcpy(&stdgc, &grid_default_cell, sizeof gc);
colour_set_fg(&stdgc, options_get_number(&s->options, "status-fg")); colour_set_fg(&stdgc, options_get_number(&s->options, "status-fg"));
colour_set_bg(&stdgc, options_get_number(&s->options, "status-bg")); colour_set_bg(&stdgc, options_get_number(&s->options, "status-bg"));
@ -361,7 +361,7 @@ status_replace(struct session *s, const char *fmt, time_t t)
case 'H': case 'H':
if (ptr == NULL) { if (ptr == NULL) {
if (gethostname(tmp, sizeof tmp) != 0) if (gethostname(tmp, sizeof tmp) != 0)
fatal("gethostname"); fatal("gethostname failed");
ptr = tmp; ptr = tmp;
} }
/* FALLTHROUGH */ /* FALLTHROUGH */
@ -565,7 +565,7 @@ status_message_set(struct client *c, const char *fmt, ...)
tv.tv_usec = (delay % 1000) * 1000L; tv.tv_usec = (delay % 1000) * 1000L;
if (gettimeofday(&c->message_timer, NULL) != 0) if (gettimeofday(&c->message_timer, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
timeradd(&c->message_timer, &tv, &c->message_timer); timeradd(&c->message_timer, &tv, &c->message_timer);
c->tty.flags |= (TTY_NOCURSOR|TTY_FREEZE); c->tty.flags |= (TTY_NOCURSOR|TTY_FREEZE);

View File

@ -1,4 +1,4 @@
/* $Id: tty-keys.c,v 1.29 2009-07-28 22:37:02 tcunha Exp $ */ /* $Id: tty-keys.c,v 1.30 2009-09-20 22:11:27 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -287,7 +287,7 @@ tty_keys_next(struct tty *tty, int *key, u_char *mouse)
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = ESCAPE_PERIOD * 1000L; tv.tv_usec = ESCAPE_PERIOD * 1000L;
if (gettimeofday(&tty->key_timer, NULL) != 0) if (gettimeofday(&tty->key_timer, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
timeradd(&tty->key_timer, &tv, &tty->key_timer); timeradd(&tty->key_timer, &tv, &tty->key_timer);
tty->flags |= TTY_ESCAPE; tty->flags |= TTY_ESCAPE;
@ -317,7 +317,7 @@ tty_keys_next(struct tty *tty, int *key, u_char *mouse)
/* If the timer hasn't expired, keep waiting. */ /* If the timer hasn't expired, keep waiting. */
if (gettimeofday(&tv, NULL) != 0) if (gettimeofday(&tv, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
if (timercmp(&tty->key_timer, &tv, >)) if (timercmp(&tty->key_timer, &tv, >))
return (1); return (1);

View File

@ -1,4 +1,4 @@
/* $Id: window.c,v 1.107 2009-09-16 12:36:28 nicm Exp $ */ /* $Id: window.c,v 1.108 2009-09-20 22:11:27 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -478,7 +478,7 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,
ws.ws_row = screen_size_y(&wp->base); ws.ws_row = screen_size_y(&wp->base);
if (gettimeofday(&wp->window->name_timer, NULL) != 0) if (gettimeofday(&wp->window->name_timer, NULL) != 0)
fatal("gettimeofday"); fatal("gettimeofday failed");
tv.tv_sec = 0; tv.tv_sec = 0;
tv.tv_usec = NAME_INTERVAL * 1000L; tv.tv_usec = NAME_INTERVAL * 1000L;
timeradd(&wp->window->name_timer, &tv, &wp->window->name_timer); timeradd(&wp->window->name_timer, &tv, &wp->window->name_timer);