summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorSami Kerola2011-04-10 12:16:09 +0200
committerKarel Zak2011-04-14 13:09:09 +0200
commit82cd61f25172948dd6300d0d0cf19d4ae187298e (patch)
tree77444f8c95f56ab68f8628c078fc93595dbe91ab /term-utils/agetty.c
parentagetty: use xalloc.h (diff)
downloadkernel-qcow2-util-linux-82cd61f25172948dd6300d0d0cf19d4ae187298e.tar.gz
kernel-qcow2-util-linux-82cd61f25172948dd6300d0d0cf19d4ae187298e.tar.xz
kernel-qcow2-util-linux-82cd61f25172948dd6300d0d0cf19d4ae187298e.zip
agetty: use program_invocation_short_name
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c21
1 files changed, 2 insertions, 19 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 0609bc5d7..91f9ee22f 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -219,10 +219,6 @@ void usage P_((void));
void error P_((const char *, ...));
#undef P_
-/* The following is used for understandable diagnostics. */
-
-char *progname;
-
/* Fake hostname for ut_host specified on command line. */
char *fakehost = NULL;
@@ -256,19 +252,6 @@ main(argc, argv)
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
- /* The BSD-style init command passes us a useless process name. */
-
-#ifdef SYSV_STYLE
- {
- char *ptr;
- progname = argv[0];
- if ((ptr = strrchr(argv[0], '/')))
- progname = ++ptr;
- }
-#else
- progname = "agetty";
-#endif
-
#ifdef DEBUGGING
dbf = fopen("/dev/ttyp0", "w");
@@ -1252,7 +1235,7 @@ error(const char *fmt, ...) {
buf[0] = '\0';
bp = buf;
#else
- (void) str2cpy(buf, progname, ": ");
+ (void) str2cpy(buf, program_invocation_short_name, ": ");
bp = buf + strlen(buf);
#endif
@@ -1288,7 +1271,7 @@ error(const char *fmt, ...) {
*/
#ifdef USE_SYSLOG
- (void) openlog(progname, LOG_PID, LOG_AUTHPRIV);
+ (void) openlog(program_invocation_short_name, LOG_PID, LOG_AUTHPRIV);
(void) syslog(LOG_ERR, "%s", buf);
closelog();
#else