summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorSami Kerola2016-07-03 21:10:11 +0200
committerSami Kerola2016-07-21 22:14:33 +0200
commit58c756c92dc4795c9c7a72df7c30b5d6ff24a74a (patch)
tree540549e4f2eeaebd074003da8970391fc097e4b5 /term-utils/agetty.c
parentsetterm: fix declarations shadowing variables in the global scope [oclint] (diff)
downloadkernel-qcow2-util-linux-58c756c92dc4795c9c7a72df7c30b5d6ff24a74a.tar.gz
kernel-qcow2-util-linux-58c756c92dc4795c9c7a72df7c30b5d6ff24a74a.tar.xz
kernel-qcow2-util-linux-58c756c92dc4795c9c7a72df7c30b5d6ff24a74a.zip
agetty: move unreachable code to pre-processor #else segment [oclint]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 07d82b9fb..d5dc0182f 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -1424,7 +1424,7 @@ static char *xgetdomainname(void)
{
#ifdef HAVE_GETDOMAINNAME
char *name;
- size_t sz = get_hostname_max() + 1;
+ const size_t sz = get_hostname_max() + 1;
name = malloc(sizeof(char) * sz);
if (!name)
@@ -1436,8 +1436,9 @@ static char *xgetdomainname(void)
}
name[sz - 1] = '\0';
return name;
-#endif
+#else
return NULL;
+#endif
}
static char *read_os_release(struct options *op, const char *varname)