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.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 7c97faffa..0d7bd1db7 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -1444,10 +1444,13 @@ static char *read_os_release(struct options *op, const char *varname)
/* read the file only once */
if (!op->osrelease) {
- fd = open(_PATH_OS_RELEASE, O_RDONLY);
+ fd = open(_PATH_OS_RELEASE_ETC, O_RDONLY);
if (fd == -1) {
- log_warn(_("cannot open %s: %m"), _PATH_OS_RELEASE);
- return NULL;
+ fd = open(_PATH_OS_RELEASE_USR, O_RDONLY);
+ if (fd == -1) {
+ log_warn(_("cannot open os-release file"));
+ return NULL;
+ }
}
if (fstat(fd, &st) < 0 || st.st_size > 4 * 1024 * 1024)