File rungetty.patch of Package rungetty

--- a/rungetty.c
+++ b/rungetty.c
@@ -313,7 +313,7 @@ get_logname (void)
 	    {
 	      if (errno == EINTR || errno == EIO || errno == ENOENT)
 		exit (0);
-	      error ("%s: read: %s", tty, sys_errlist[errno]);
+	      error ("%s: read: %m", tty);
 	    }
 	  if (c == '\n' || c == '\r')
 	    {
@@ -430,7 +430,7 @@ mingetty_login (char *logname, char *tty
       while ((logname = get_logname ()) == 0);
       execl (_PATH_LOGIN, _PATH_LOGIN, "--", logname, NULL);
     }
-  error ("%s: can't exec " _PATH_LOGIN ": %s", tty, sys_errlist[errno]);
+  error ("%s: can't exec " _PATH_LOGIN ": %m", tty);
   exit (0);
 }
 
@@ -446,7 +446,7 @@ open_tty (void)
   strcpy (buf, "/dev/");
   strcat (buf, tty);
   if (chown (buf, 0, 0) || chmod (buf, 0600))
-    error ("%s: %s", buf, sys_errlist[errno]);
+    error ("%s: %m", buf);
 
   sa.sa_handler = SIG_IGN;
   sa.sa_flags = 0;
@@ -461,7 +461,7 @@ open_tty (void)
    */
   if ((fd = open (buf, O_RDWR, 0)) < 0
       || ioctl (fd, TIOCSCTTY, (void *) 1) == -1)
-    error ("%s: cannot open tty: %s", buf, sys_errlist[errno]);
+    error ("%s: cannot open tty: %m", buf);
   if (!isatty (fd))
     error ("%s: not a tty", buf);
 
@@ -474,12 +474,11 @@ open_tty (void)
   /* ioctl (0, TIOCNOTTY, (char *)1); */
 
   if (open (buf, O_RDWR, 0) != 0)
-    error ("%s: cannot open as standard input: %s", buf,
-	   sys_errlist[errno]);
+    error ("%s: cannot open as standard input: %m", buf);
 
   /* Set up standard output and standard error file descriptors. */
   if (dup (0) != 1 || dup (0) != 2)
-    error ("%s: dup problem: %s", buf, sys_errlist[errno]);
+    error ("%s: dup problem: %m", buf);
 
   /* Write a reset string to the terminal. This is very linux-specific
      and should be checked for other systems. */
@@ -605,6 +604,6 @@ main (int argc, char **argv)
   nice (priority);
 
   execvp (program_run, &argv[optind + 1]);
-  error ("%s: can't exec %s : %s", tty, program_run, sys_errlist[errno]);
+  error ("%s: can't exec %s : %m", tty, program_run);
   exit (0);
 }
openSUSE Build Service is sponsored by