summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index d5dc0182f..d6cec8f20 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -45,6 +45,7 @@
#include "widechar.h"
#include "ttyutils.h"
#include "color-names.h"
+#include "env.h"
#ifdef USE_PLYMOUTH_SUPPORT
# include "plymouth-ctrl.h"
@@ -1155,7 +1156,8 @@ static void open_tty(char *tty, struct termios *tp, struct options *op)
op->term = DEFAULT_STERM;
}
- setenv("TERM", op->term, 1);
+ if (setenv("TERM", op->term, 1) != 0)
+ log_err(_("failed to set the %s environment variable"), "TERM");
}
/* Initialize termios settings. */