projects
/
u
/
mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Track @dstr_vputf@ change.
[u/mdw/catacomb]
/
pixie.c
diff --git
a/pixie.c
b/pixie.c
index
5482798
..
f2a3b2f
100644
(file)
--- a/
pixie.c
+++ b/
pixie.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-c-*-
*
- * $Id: pixie.c,v 1.
9 2001/02/03 16:06:44
mdw Exp $
+ * $Id: pixie.c,v 1.
11 2002/01/13 13:43:05
mdw Exp $
*
* Passphrase pixie for Catacomb
*
*
* Passphrase pixie for Catacomb
*
@@
-30,6
+30,12
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: pixie.c,v $
/*----- Revision history --------------------------------------------------*
*
* $Log: pixie.c,v $
+ * Revision 1.11 2002/01/13 13:43:05 mdw
+ * Fix bug in daemon mode.
+ *
+ * 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.
* 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
+1110,8
@@
static void c_sline(char *s, void *p)
selbuf_destroy(&c_client);
}
exit(0);
selbuf_destroy(&c_client);
}
exit(0);
- }
else
-
puts(s);
+ }
+ puts(s);
}
/* --- @pix_client@ --- *
}
/* --- @pix_client@ --- *
@@
-1155,8
+1161,10
@@
static void pix_client(struct sockaddr_un *sun, size_t sz, char *argv[])
/* --- And repeat --- */
/* --- And repeat --- */
- for (;;)
- sel_select(&sel);
+ for (;;) {
+ if (sel_select(&sel))
+ die(EXIT_FAILURE, "select error: %s", strerror(errno));
+ }
}
/*----- Main code ---------------------------------------------------------*/
}
/*----- Main code ---------------------------------------------------------*/
@@
-1438,7
+1446,7
@@
int main(int argc, char *argv[])
chdir("/");
setsid();
chdir("/");
setsid();
- if (fork()
>
= 0)
+ if (fork()
!
= 0)
_exit(0);
}
_exit(0);
}