From 6f0016042a8c497e22ea7421c66d61fa46230fd5 Mon Sep 17 00:00:00 2001 From: Kaj-Michael Lang Date: Fri, 4 Jan 2008 15:25:41 +0200 Subject: [PATCH] Add some error output for file open ops --- src/osm.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/osm.c b/src/osm.c index 1fa3415..ce8fc63 100644 --- a/src/osm.c +++ b/src/osm.c @@ -1689,11 +1689,14 @@ gchar buffer[FILE_BUFFER]; gboolean res=TRUE; f=fopen(pfile, "r"); -if (!f) +if (!f) { + perror("fopen failed\n"); return FALSE; +} b=BZ2_bzReadOpen(&bzerror, f, 0, 0, NULL, 0); if (bzerror != BZ_OK) { + g_printf("BZ2_bzReadOpen failed\n"); BZ2_bzReadClose(&bzerror, b); return FALSE; } @@ -1765,8 +1768,10 @@ db_prepare(); print_memory_usage(); osm_planet_parser_init(); -if (osm_planet_parse_file(argv[1])==FALSE) +if (osm_planet_parse_file(argv[1])==FALSE) { + g_printf("Failed to parse file: %s\n", argv[1]); return 1; +} g_printf("Total nodes %d, POIs: %d and Ways %d.\n", node_cnt, noded_cnt, way_cnt); g_printf("Cities/Towns: %d\n", g_hash_table_size(osm_place_city)); -- 2.39.5