summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hubbs <williamh@gentoo.org>2012-03-26 15:04:40 -0500
committerWilliam Hubbs <williamh@gentoo.org>2012-03-26 15:04:40 -0500
commit300c03203dd5f9f525dc330d24bacc0e07f57766 (patch)
tree1e2946b45eaac4504102b271c268570f0a189713
parentf9162438bca8c8449f1f663a60c47229f0c08316 (diff)
downloadopenrc-300c03203dd5f9f525dc330d24bacc0e07f57766.tar.gz
openrc-300c03203dd5f9f525dc330d24bacc0e07f57766.tar.bz2
openrc-300c03203dd5f9f525dc330d24bacc0e07f57766.tar.xz
librc: Do not output error messages from within the library.
This fixes a compile issue. Also, it is cleaner to have the client output error messages as opposed to having the library do this. Reported-by: Ewoud Kohl van Wijngaarden <gentoo@kohlvanwijngaarden.nl> X-Gentoo-Bug: 409743 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=409743
-rw-r--r--src/librc/librc-misc.c12
-rw-r--r--src/rc/rc.c7
2 files changed, 10 insertions, 9 deletions
diff --git a/src/librc/librc-misc.c b/src/librc/librc-misc.c
index 06f97e7..b907c5c 100644
--- a/src/librc/librc-misc.c
+++ b/src/librc/librc-misc.c
@@ -29,7 +29,6 @@
*/
#include "librc.h"
-#include "einfo.h"
bool
rc_yesno(const char *value)
@@ -139,15 +138,13 @@ rc_proc_getent(const char *ent)
if (!exists("/proc/cmdline"))
return NULL;
- if (!(fp = fopen("/proc/cmdline", "r"))) {
- eerror("failed to open `/proc/cmdline': %s", strerror(errno));
+ if (!(fp = fopen("/proc/cmdline", "r")))
return NULL;
- }
proc = NULL;
i = 0;
if (rc_getline(&proc, &i, fp) == -1 || proc == NULL)
- eerror("rc_getline: %s", strerror(errno));
+ return NULL;
if (proc != NULL) {
len = strlen(ent);
@@ -394,13 +391,10 @@ rc_conf_value(const char *setting)
atexit(_free_rc_conf);
#endif
- /* Support old configs, but complain about it. */
+ /* Support old configs. */
if (exists(RC_CONF_OLD)) {
old = rc_config_load(RC_CONF_OLD);
TAILQ_CONCAT(rc_conf, old, entries);
- ewarn("Your system still has %s", RC_CONF_OLD);
- ewarn("Please migrate to the appropriate settings in %s", RC_CONF);
- ewarn("and delete %s.", RC_CONF_OLD);
#ifdef DEBUG_MEMORY
free(old);
#endif
diff --git a/src/rc/rc.c b/src/rc/rc.c
index 4cf0374..2590048 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -793,6 +793,13 @@ main(int argc, char **argv)
env_filter();
env_config();
+ /* complain about old configuration settings if they exist */
+ if (exists(RC_CONF_OLD)) {
+ ewarn("%s still exists on your system and should be removed.",
+ RC_CONF_OLD);
+ ewarn("Please migrate to the appropriate settings in %s", RC_CONF);
+ }
+
argc++;
argv--;
while ((opt = getopt_long(argc, argv, getoptstring,