* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
**************************************************************************/
#include <errno.h>
#include <string.h>
#include <stdio.h>
+
+#include <simgear/structure/exception.hxx>
+
#include "timezone.h"
SGTimeZone::SGTimeZone(float la, float lo, char* cc, char* desc) :
char buffer[256];
FILE* infile = fopen(filename, "rb");
if (!(infile)) {
- fprintf(stderr, "Unable to open file %s\n", filename);
- exit(1);
+ string e = "Unable to open time zone file '";
+ throw sg_exception(e + filename + '\'');
+
} else {
errno = 0;
errno = 0;
}
}
+ fclose(infile);
}
SGTimeZoneContainer::~SGTimeZoneContainer()