Mercurial > audlegacy
changeset 4124:d217b71e5836
more strict error handling. make use of AUDDBG
author | Eugene Zagidullin <e.asphyx@gmail.com> |
---|---|
date | Wed, 26 Dec 2007 19:17:19 +0300 |
parents | ab59718d8704 |
children | cbdf2cc5e947 |
files | src/audacious/skin.c src/audacious/util.c |
diffstat | 2 files changed, 10 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/src/audacious/skin.c Tue Dec 25 17:21:04 2007 -0600 +++ b/src/audacious/skin.c Wed Dec 26 19:17:19 2007 +0300 @@ -22,7 +22,7 @@ * The Audacious team does not consider modular code linking to * Audacious or using our public API to be a derived work. */ - +#define AUD_DEBUG #ifdef HAVE_CONFIG_H # include "config.h" #endif
--- a/src/audacious/util.c Tue Dec 25 17:21:04 2007 -0600 +++ b/src/audacious/util.c Wed Dec 26 19:17:19 2007 +0300 @@ -23,7 +23,7 @@ * Audacious or using our public API to be a derived work. */ -/* #define AUD_DEBUG 1 */ +#define AUD_DEBUG #ifdef HAVE_CONFIG_H # include "config.h" @@ -78,7 +78,7 @@ FindFileContext *context = data; if (strlen(path) > FILENAME_MAX) { - g_warning("Ignoring path: name too long (%s)", path); + AUDDBG("Ignoring path: name too long (%s)\n", path); return TRUE; } @@ -302,8 +302,8 @@ tmpdir = g_build_filename(g_get_tmp_dir(), "audacious.XXXXXXXX", NULL); if (!mkdtemp(tmpdir)) { g_free(tmpdir); - g_message("Unable to load skin: Failed to create temporary " - "directory: %s", g_strerror(errno)); + AUDDBG("Unable to load skin: Failed to create temporary " + "directory: %s\n", g_strerror(errno)); return NULL; } #else @@ -316,14 +316,16 @@ g_free(escaped_filename); if (!cmd) { - g_message("extraction function is NULL!"); + AUDDBG("extraction function is NULL!\n"); g_free(tmpdir); return NULL; } - if(system(cmd) == -1) + AUDDBG("Attempt to execute \"%s\"\n", cmd); + + if(system(cmd) != 0) { - g_message("could not execute cmd %s",cmd); + AUDDBG("could not execute cmd %s\n",cmd); g_free(cmd); return NULL; }