commit 2db2e37b148b01e53e10631ecfbfd437a06b4391
Author: Simon Howard <fraggle@soulsphere.org>
AuthorDate: Sun Oct 21 20:17:28 2018 -0400
Commit: Simon Howard <fraggle@soulsphere.org>
CommitDate: Sun Oct 21 20:17:28 2018 -0400
setup: Fix warning about unused result.
Just show an error dialog if the command fails.
---
src/setup/sound.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/src/setup/sound.c b/src/setup/sound.c
index 9c4a21bb..d3ce01fb 100644
--- a/src/setup/sound.c
+++ b/src/setup/sound.c
@@ -116,6 +116,7 @@ static txt_dropdown_list_t *OPLTypeSelector(void)
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 @@ static void OpenMusicPackDir(TXT_UNCAST_ARG(widget), TXT_UNCAST_ARG(unused))
#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)