1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
$NetBSD: patch-ap,v 1.11 2009/02/26 19:45:14 sno Exp $
--- lib/gvc/gvconfig.c.orig 2008-12-01 12:48:23.000000000 +0100
+++ lib/gvc/gvconfig.c 2008-12-01 12:50:26.000000000 +0100
@@ -526,10 +526,7 @@
}
else {
f = fopen(gvc->config_path,"r");
- if (!f) {
- agerr (AGERR,"failed to open %s for read.\n", gvc->config_path);
- }
- else {
+ if (f) {
config_text = gmalloc(config_st.st_size + 1);
sz = fread(config_text, 1, config_st.st_size, f);
if (sz == 0) {
@@ -542,10 +539,13 @@
rc = gvconfig_plugin_install_from_config(gvc, config_text);
/* NB. config_text not freed because we retain char* into it */
}
- }
- if (f) {
+
fclose(f);
- }
+ }
+ else {
+ agerr (AGERR,"failed to open %s for read.\n", gvc->config_path);
+ exit(1);
+ }
}
}
#endif
|