]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Make ply_terminal_set_fd() update terminal->name .
authorPeter Jones <pjones@redhat.com>
Tue, 3 Jun 2008 18:52:33 +0000 (14:52 -0400)
committerPeter Jones <pjones@pjones2.localdomain>
Tue, 3 Jun 2008 18:52:33 +0000 (14:52 -0400)
src/libply/ply-terminal.c

index d51813e9ba06326b0f657df3bd00e3ae1b668731..9ad293f17cdbf86a922ac99d289bff0307df492d 100644 (file)
@@ -140,6 +140,15 @@ ply_terminal_set_fd (ply_terminal_t *terminal, int fd)
   assert (terminal != NULL);
 
   terminal->fd = fd;
+
+  if (terminal->name)
+    {
+      free(terminal->name);
+      terminal->name = NULL;
+    }
+    
+  if (terminal->fd >= 0)
+    terminal->name = strdup (ptsname (terminal->fd));
 }
 
 const char *