]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: use program_invocation_short_name
authorSami Kerola <kerolasa@iki.fi>
Sun, 10 Apr 2011 10:16:09 +0000 (12:16 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 14 Apr 2011 11:09:09 +0000 (13:09 +0200)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
term-utils/agetty.c

index 0609bc5d7ee8874353622f172fc12153073ef42a..91f9ee22f7f7af0d37dc168f394157cae6a237d6 100644 (file)
@@ -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