From: mdw Date: Wed, 21 Feb 2001 20:03:54 +0000 (+0000) Subject: Handle select errors (by bombing out). Cosmetic tweak. X-Git-Url: https://git.distorted.org.uk/u/mdw/catacomb/commitdiff_plain/81b5dd60a2618cfe17d69f0ddd754d25825299c6 Handle select errors (by bombing out). Cosmetic tweak. --- diff --git a/pixie.c b/pixie.c index 5482798..363f833 100644 --- a/pixie.c +++ b/pixie.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: pixie.c,v 1.9 2001/02/03 16:06:44 mdw Exp $ + * $Id: pixie.c,v 1.10 2001/02/21 20:03:54 mdw Exp $ * * Passphrase pixie for Catacomb * @@ -30,6 +30,9 @@ /*----- Revision history --------------------------------------------------* * * $Log: pixie.c,v $ + * Revision 1.10 2001/02/21 20:03:54 mdw + * Handle select errors (by bombing out). Cosmetic tweak. + * * Revision 1.9 2001/02/03 16:06:44 mdw * Don't set a handler for @SIGINT@ if it's ignored at startup. Add some * error handling for the @select@ loop. @@ -1104,8 +1107,8 @@ static void c_sline(char *s, void *p) selbuf_destroy(&c_client); } exit(0); - } else - puts(s); + } + puts(s); } /* --- @pix_client@ --- * @@ -1155,8 +1158,10 @@ static void pix_client(struct sockaddr_un *sun, size_t sz, char *argv[]) /* --- And repeat --- */ - for (;;) - sel_select(&sel); + for (;;) { + if (sel_select(&sel)) + die(EXIT_FAILURE, "select error: %s", strerror(errno)); + } } /*----- Main code ---------------------------------------------------------*/