shithub: choc

Download patch

ref: 2db2e37b148b01e53e10631ecfbfd437a06b4391
parent: a066000012f92f0e98610a6ae975af9f67f242d0
author: Simon Howard <[email protected]>
date: Sun Oct 21 16:17:28 EDT 2018

setup: Fix warning about unused result.

Just show an error dialog if the command fails.

--- a/src/setup/sound.c
+++ b/src/setup/sound.c
@@ -116,6 +116,7 @@
 static void OpenMusicPackDir(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
 {
     char *cmd;
+    int result;
 
 #if defined(__MACOSX__)
     cmd = M_StringJoin("open \"", music_pack_path, "\"", NULL);
@@ -124,8 +125,13 @@
 #else
     cmd = M_StringJoin("xdg-open \"", music_pack_path, "\"", NULL);
 #endif
-    system(cmd);
+    result = system(cmd);
     free(cmd);
+
+    if (result != 0)
+    {
+        TXT_MessageBox("Error", "Failed to open music pack directory.");
+    }
 }
 
 void ConfigSound(TXT_UNCAST_ARG(widget), void *user_data)