summaryrefslogtreecommitdiffstats
path: root/sys-utils/rtcwake.c
diff options
context:
space:
mode:
authorSami Kerola2016-08-07 08:27:21 +0200
committerSami Kerola2016-08-12 22:25:36 +0200
commit984a60965a0e3cd3253a74c77af916b05381c03d (patch)
tree8aafe4e47b256298b2ed294dbdcdc50c59c730bf /sys-utils/rtcwake.c
parenttests: mark build-in paths test as optional (diff)
downloadkernel-qcow2-util-linux-984a60965a0e3cd3253a74c77af916b05381c03d.tar.gz
kernel-qcow2-util-linux-984a60965a0e3cd3253a74c77af916b05381c03d.tar.xz
kernel-qcow2-util-linux-984a60965a0e3cd3253a74c77af916b05381c03d.zip
misc: always check setenv(3) return value
At least glibc setenv(3) can fail when system runs out of memory. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'sys-utils/rtcwake.c')
-rw-r--r--sys-utils/rtcwake.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c
index 536c5bf5c..f4e630a33 100644
--- a/sys-utils/rtcwake.c
+++ b/sys-utils/rtcwake.c
@@ -34,6 +34,7 @@
#include "c.h"
#include "closestream.h"
+#include "env.h"
#include "nls.h"
#include "optutils.h"
#include "pathnames.h"
@@ -157,7 +158,7 @@ static int get_basetimes(struct rtcwake_control *ctl, int fd)
* with the system clock (which always uses UTC).
*/
if (ctl->clock_mode == CM_UTC)
- setenv("TZ", "UTC", 1);
+ xsetenv("TZ", "UTC", 1);
tzset();
/* Read rtc and system clocks "at the same time", or as
* precisely (+/- a second) as we can read them.