replacing stderr
Hi
Trying to do some janitors task, I read on the TODO
"
Nothing should send error messages to stderr. If there is an error,
use debconf to display a message. stderr messages will overwrite the
newt frontend.
"
I found the following files use stderr:
packages/autopartkit/dummylog.c
packages/autopartkit/mapdevfs.c
packages/base-installer/run-debootstrap.c
packages/cdebconf/src/test/dbtest.c
packages/cdebconf/src/rfc822.c
packages/cdebconf/src/debconf.c
packages/cdebconf/src/debug.c
packages/cdebconf/src/debconf-communicate.c
packages/cdebconf/src/modules/db/rfc822db/rfc822db.c
packages/cdebconf/src/modules/db/perldb/perldb.c
packages/cdebconf/src/modules/frontend/corba/corba.c
packages/cdebconf/src/modules/frontend/corba/dcf-text.c
packages/cdebconf/src/debconf-loadtemplate.c
packages/cdebconf/src/confmodule.c
packages/cdebconf/src/template.c
packages/choose-mirror/choose-mirror.c
packages/debian-installer-utils/pipe_progress.c
packages/debian-installer-utils/mapdevfs.c
packages/kbd-chooser/usb-kbd.c
packages/libdebian-installer/src/log.c
packages/libdebian-installer/src/exec.c
packages/libdebian-installer/src/system/devfs.c
packages/netcfg/netcfg-common.c
packages/partconf/partconf.c
packages/partconf/mkfstab.c
packages/partman/partman/parted_server.c
packages/udpkg/depends.c
packages/udpkg/udpkg.c
packages/udpkg/status.c
I wonder what is the best way to replace something like
fprintf(stderr, "my old error string message");
At the moment my idea is to add/replace:
#include <cdebconf/debconfclient.h> // when it is necessary
struct debconfclient *debconf = NULL; // when if it is necessary
char estr[] = "my old error string message";
debconf_subst(debconf, DEBCONF_BASE "fallback-error", "ERROR", estr);
How am I far from the best replacing solution?
Thanks a lot.
--
Carlo Perassi - http://www.linux.it/~carlo/
I don't use fancy debuggers, I use print statements (Brian Kernighan)
Reply to: