+2003-08-08 Michael Reinelt <reinelt@lizard.reinelt>
+
+ * ChangeLog, TODO, config.h.in, configure, configure.in, dvb.c, CREDITS:
+ uClibc compatibility issue; small glitch in dvb.c
+
2003-08-01 Michael Reinelt <reinelt@lizard.reinelt>
* Cwlinux.c, Makefile.am, Makefile.in, README, T6963.c:
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core core.* *.core &&
+ rm -f core *.core &&
rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
( exit $ac_status )
ac_cv_func_fork_works=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
( exit $ac_status )
ac_cv_func_vfork_works=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
fi
fi
-#removed for ulibc compatibility
+#removed for uClibc compatibility
#AC_FUNC_MALLOC
echo "$as_me:$LINENO: checking for working memcmp" >&5
echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6
( exit $ac_status )
ac_cv_func_memcmp_working=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_memcmp_working" >&5
( exit $ac_status )
ac_cv_func_realloc_0_nonnull=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5
( exit $ac_status )
ac_cv_func_lstat_dereferences_slashed_symlink=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
else
# If the `ln -s' command failed, then we probably don't even
( exit $ac_status )
ac_cv_func_stat_empty_string_bug=no
fi
-rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_stat_empty_string_bug" >&5
-/* $Id: debug.c,v 1.3 2001/03/12 12:39:36 reinelt Exp $
+/* $Id: debug.c,v 1.4 2003/08/08 06:58:06 reinelt Exp $
*
* debug() and error() functions
*
*
*
* $Log: debug.c,v $
+ * Revision 1.4 2003/08/08 06:58:06 reinelt
+ * improved forking
+ *
* Revision 1.3 2001/03/12 12:39:36 reinelt
*
* reworked autoconf a lot: drivers may be excluded, #define's went to config.h
static int log_open=0;
extern int debugging;
extern int foreground;
+ extern int background;
if (level>debugging) return;
(void) vsnprintf(buffer, sizeof(buffer), format, ap);
va_end(ap);
- if (foreground) {
+ if (!background) {
#ifdef WITH_TEXT
extern int curs_err(char *);
if (!curs_err(buffer))
#endif
- fprintf (level?stdout:stderr, "%s\n", buffer);
- return;
+ fprintf (level?stdout:stderr, "%s\n", buffer);
}
-
+
+ if (foreground)
+ return;
+
if (!log_open) {
openlog ("LCD4Linux", LOG_PID, LOG_USER);
log_open=1;
-/* $Id: lcd4linux.c,v 1.39 2003/07/24 04:48:09 reinelt Exp $
+/* $Id: lcd4linux.c,v 1.40 2003/08/08 06:58:06 reinelt Exp $
*
* LCD4Linux
*
*
*
* $Log: lcd4linux.c,v $
+ * Revision 1.40 2003/08/08 06:58:06 reinelt
+ * improved forking
+ *
* Revision 1.39 2003/07/24 04:48:09 reinelt
* 'soft clear' needed for virtual rows
*
int got_signal=0;
int debugging=0;
int foreground=0;
+int background=0;
int tick, tack;
static void usage(void)
exit(2);
}
+ info ("Version " VERSION " starting");
+ if (!foreground && (my_argv[0]==NULL || my_argv[0][0]!='/')) {
+ info ("invoked without full path; restart may not work!");
+ }
+
+ // set default values
+ cfg_set ("row1", "*** %o %v ***");
+ cfg_set ("row2", "%p CPU %r MB RAM");
+ cfg_set ("row3", "Busy %cu%% $r10cu");
+ cfg_set ("row4", "Load %l1%L$r10l1");
+
+ if (cfg_read (cfg)==-1)
+ exit (1);
+
+ driver=cfg_get("display",NULL);
+ if (driver==NULL || *driver=='\0') {
+ error ("missing 'display' entry in %s!", cfg_file());
+ exit (1);
+ }
+
if (!foreground) {
pid_t i;
int fd;
// ignore nasty signals
signal(SIGINT, SIG_IGN);
signal(SIGQUIT, SIG_IGN);
+
+ // chdir("/")
+ if (chdir("/")!=0) {
+ error ("chdir(\"/\") failed: %s", strerror(errno));
+ exit (1);
+ }
+
+ // we want full control over permissions
+ umask (0);
+
// detach stdin
if (freopen("/dev/null", "r", stdin)==NULL) {
error ("freopen (/dev/null) failed: %s", strerror(errno));
exit (1);
}
+
// detach stdout and stderr
fd=open("/dev/null", O_WRONLY, 0666);
if (fd==-1) {
dup2(fd, STDOUT_FILENO);
dup2(fd, STDERR_FILENO);
close(fd);
- }
-
- if (foreground) {
- info ("Version " VERSION " starting");
- } else {
- info ("Version " VERSION " starting");
- if (my_argv[0]==NULL || my_argv[0][0]!='/') {
- info ("invoked without full path; restart may not work!");
- }
- }
-
- // set default values
- cfg_set ("row1", "*** %o %v ***");
- cfg_set ("row2", "%p CPU %r MB RAM");
- cfg_set ("row3", "Busy %cu%% $r10cu");
- cfg_set ("row4", "Load %l1%L$r10l1");
-
- if (cfg_read (cfg)==-1)
- exit (1);
-
- driver=cfg_get("display",NULL);
- if (driver==NULL || *driver=='\0') {
- error ("missing 'display' entry in %s!", cfg_file());
- exit (1);
+ background=1;
}
debug ("initializing driver %s", driver);