From 6ea4f7dfc008f8c62274de128aad3f341fdbcee2 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 13 Apr 2010 20:54:57 +0000 Subject: [PATCH] Add error diagnostic for setenv failure. --- daemons/clvmd/clvmd.c | 3 ++- daemons/dmeventd/dmeventd.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/daemons/clvmd/clvmd.c b/daemons/clvmd/clvmd.c index b7ba20098..7f402bb38 100644 --- a/daemons/clvmd/clvmd.c +++ b/daemons/clvmd/clvmd.c @@ -365,7 +365,8 @@ int main(int argc, char *argv[]) * used by some glibc (on some distributions it takes over 100MB). * Daemon currently needs to use mlockall(). */ - setenv("LANG", "C", 1); + if (setenv("LANG", "C", 1) != 0) + perror("Can not set LANG to C"); /* Fork into the background (unless requested not to) */ if (debug != DEBUG_STDERR) { diff --git a/daemons/dmeventd/dmeventd.c b/daemons/dmeventd/dmeventd.c index 12c002f4a..71963d56f 100644 --- a/daemons/dmeventd/dmeventd.c +++ b/daemons/dmeventd/dmeventd.c @@ -1703,7 +1703,8 @@ int main(int argc, char *argv[]) * used by some glibc (on some distributions it takes over 100MB). * Daemon currently needs to use mlockall(). */ - setenv("LANG", "C", 1); + if (setenv("LANG", "C", 1) != 0) + perror("Can not set LANG to C"); if (!_debug) _daemonize();