[memprof: 25/76] server.c: Handle return value of mktemp



commit bc321b382bc98397f5b731ed9a78f386b9f1cad3
Author: Holger Hans Peter Freyther <zecke selfish org>
Date:   Thu Jun 4 13:20:21 2009 +0200

    server.c: Handle return value of mktemp

 src/server.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/server.c b/src/server.c
index 5d1f6ac..0f7c45e 100644
--- a/src/server.c
+++ b/src/server.c
@@ -435,7 +435,8 @@ create_control_socket (MPServer *server)
 		
 #else  /* !USE_SOCKET_DIRECTORY */
 	server->socket_path = g_build_filename (g_get_tmp_dir(), SOCKET_TEMPLATE, NULL);
-	mktemp (server->socket_path);
+	if (strlen(mktemp (server->socket_path)) == 0)
+		fatal ("mktemp: %s\n", g_strerror (errno));
 #endif /* USE_SOCKET_DIRECTORY */
 
 	strncpy (addr.sun_path, server->socket_path, sizeof (addr.sun_path));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]