]> err.no Git - systemd/commitdiff
socket: fix const issue
authorLennart Poettering <lennart@poettering.net>
Wed, 3 Feb 2010 13:25:50 +0000 (14:25 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 3 Feb 2010 13:25:50 +0000 (14:25 +0100)
socket.c

index 6d871f645f707d1d02ea7409c41074a3c4209199..6b1da016dd4cdb13695f9a914a38ee8b6c04bcb4 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -159,14 +159,14 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
         SocketExecCommand c;
         Socket *s = SOCKET(u);
         SocketPort *p;
-        char *prefix2;
+        const char *prefix2;
+        char *p2;
 
         assert(s);
         assert(f);
 
-        prefix2 = strappend(prefix, "\t");
-        if (!prefix2)
-                prefix2 = "";
+        p2 = strappend(prefix, "\t");
+        prefix2 = p2 ? p2 : prefix;
 
         fprintf(f,
                 "%sSocket State: %s\n"
@@ -211,7 +211,7 @@ static void socket_dump(Unit *u, FILE *f, const char *prefix) {
                 exec_command_dump_list(s->exec_command[c], f, prefix2);
         }
 
-        free(prefix2);
+        free(p2);
 }
 
 static void socket_close_fds(Socket *s) {