[glick2] Gracefully handle failure to stat bundle dir
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glick2] Gracefully handle failure to stat bundle dir
- Date: Wed, 2 May 2012 12:56:01 +0000 (UTC)
commit cdbc5ef21561b8b835d37c45b381c3305c1f14c4
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date: Sun Apr 15 22:05:18 2012 +0300
Gracefully handle failure to stat bundle dir
This can happen for example when an inexistant directory is accidently
specified.
mkbundle.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/mkbundle.c b/mkbundle.c
index f1f6fcf..c6583f6 100644
--- a/mkbundle.c
+++ b/mkbundle.c
@@ -6,6 +6,7 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
+#include <errno.h>
#include <glib.h>
#include <gio/gio.h>
#include "format.h"
@@ -41,8 +42,8 @@ slurp_files (const char *full_path, const char *relative_path, const char *name)
if (res != 0)
{
- g_free (file);
- return NULL;
+ g_printerr ("Can't read file %s: %s\n", full_path, strerror (errno));
+ exit (1);
}
file->name = g_strdup (name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]