Skip to contentSkip to conversation

client: remove warning on mkdir return

PATCH Superseded James Prestwood 1 participant 1 message Feb 9, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 client: remove warning on mkdir return

This reverts a previous commit which breaks iwctl. The check was added to satisfy static analysis but it ended up preventing iwctl from starting. In this case mkdir can fail (e.g. if the directory already exists).

---
 client/display.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
client/display.c +1 -7
index 4b9ee8f0..961ad419 100644
@@ -681,7 +681,6 @@ void display_init(void)
 {
 	const char *data_home;
 	char *data_path;
-	int ret;
 
 	display_refresh.redo_entries = l_queue_new();
 
@@ -702,12 +701,7 @@ void display_init(void)
 	}
 
 	if (data_path) {
-		ret = mkdir(data_path, 0700);
-		/* Not much can be done since display isn't even initialized */
-		if (L_WARN_ON(ret < 0)) {
-			l_free(data_path);
-			return;
-		}
+		mkdir(data_path, 0700);
 
 		history_path = l_strdup_printf("%s/history", data_path);
 		read_history(history_path);
Signature · 1 line
2.26.2