]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
Make ply_terminal_get_name return a non-freeable string
authorRay Strode <rstrode@redhat.com>
Wed, 16 May 2007 18:56:42 +0000 (14:56 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 16 May 2007 18:56:42 +0000 (14:56 -0400)
Previously ply_terminal_get_name would return a duplicated
copy of its name that the caller would have to free.

src/ply-terminal.c
src/ply-terminal.h

index 11876beda595f4104d748f65e2d20212b2a9cbd7..196ff3a0d507495093c2a432b2fd1ce695ee10a6 100644 (file)
@@ -124,14 +124,14 @@ ply_terminal_get_fd (ply_terminal_t *terminal)
   return terminal->fd;
 }
 
-char *
+const char *
 ply_terminal_get_name (ply_terminal_t *terminal)
 {
   assert (terminal != NULL);
   assert (ply_terminal_is_open (terminal));
 
   assert (terminal->name != NULL);
-  return strdup (terminal->name);
+  return terminal->name;
 }
 
 #ifdef PLY_TERMINAL_ENABLE_TEST
@@ -143,7 +143,7 @@ main (int    argc,
       char **argv)
 {
   ply_terminal_t *terminal;
-  char *name;
+  const char *name;
   uint8_t byte;
   int exit_code;
 
index cfdc3c570b20d255c7b102447272b36c4d2d55ed..4821ed2671e1ebf178e0be8828c89b57328a99e1 100644 (file)
@@ -35,7 +35,7 @@ bool ply_terminal_open (ply_terminal_t *terminal);
 bool ply_terminal_is_open (ply_terminal_t *terminal);
 void ply_terminal_close (ply_terminal_t *terminal);
 int ply_terminal_get_fd (ply_terminal_t *terminal);
-char *ply_terminal_get_name (ply_terminal_t *terminal);
+const char *ply_terminal_get_name (ply_terminal_t *terminal);
 #endif
 
 #endif /* PLY_TERMINAL_H */