summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
181efe6)
Reading stdin drives to problems when afb-daemon
is launched with its input either closed or
connected to /dev/null.
Conversely, launching afb-daemon with the option
--daemon is not always possible because it really
daemonizes itself what forbids to control it
or its group directly.
Change-Id: I182741226762110809e50d68154f5d29d133303b
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
// infinite loop
PUBLIC AFB_error httpdLoop(AFB_session *session) {
// infinite loop
PUBLIC AFB_error httpdLoop(AFB_session *session) {
- static int count = 0;
-
if (verbose) fprintf(stderr, "AFB:notice entering httpd waiting loop\n");
if (verbose) fprintf(stderr, "AFB:notice entering httpd waiting loop\n");
- if (session->foreground) {
-
- while (TRUE) {
- fprintf(stderr, "AFB:notice Use Ctrl-C to quit\n");
- (void) getc(stdin);
- }
- } else {
- while (TRUE) {
- sleep(3600);
- if (verbose) fprintf(stderr, "AFB:notice httpd alive [%d]\n", count++);
- }
+ while (TRUE) {
+ sleep(3600);
+ if (verbose) fprintf(stderr, "AFB:notice httpd alive [%d]\n", count++);
}
// should never return from here
}
// should never return from here
// open syslog if ever needed
openlog("AGB-log", 0, LOG_DAEMON);
// open syslog if ever needed
openlog("AGB-log", 0, LOG_DAEMON);
- // -------------- Try to kill any previsou process if asked ---------------------
+ // -------------- Try to kill any previous process if asked ---------------------
if (session->killPrevious) {
pid = readPidFile (session->config); // enforce commandline option
switch (pid) {
if (session->killPrevious) {
pid = readPidFile (session->config); // enforce commandline option
switch (pid) {