From 7b57982feea57e11a52aa006d5b8b59ee3f03084 Mon Sep 17 00:00:00 2001 From: germeier Date: Sat, 24 Apr 2004 16:09:57 +0000 Subject: further open/close fixes --- libmpio/src/mpio.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'libmpio/src/mpio.c') diff --git a/libmpio/src/mpio.c b/libmpio/src/mpio.c index d5667d1..229644e 100644 --- a/libmpio/src/mpio.c +++ b/libmpio/src/mpio.c @@ -1,5 +1,5 @@ /* - * $Id: mpio.c,v 1.14 2004/04/23 19:21:07 germeier Exp $ + * $Id: mpio.c,v 1.15 2004/04/24 16:09:58 germeier Exp $ * * libmpio - a library for accessing Digit@lways MPIO players * Copyright (C) 2002-2004 Markus Germeier @@ -95,9 +95,9 @@ static mpio_error_t mpio_errors[] = { { MPIO_ERR_DIR_NOT_EMPTY, "The selected directory is not empty." }, { MPIO_ERR_DEVICE_NOT_READY, - "Could not open " MPIO_DEVICE "\n" - "Verify that the mpio module is loaded and " - "your MPIO is\nconnected and powered up.\n" }, + "Could not access the player\n" + "Verify that the the player is\n" + "connected and powered up.\n" }, { MPIO_ERR_OUT_OF_MEMORY, "Out of Memory." }, { MPIO_ERR_INTERNAL, @@ -314,11 +314,14 @@ mpio_init(mpio_callback_init_t progress_callback) new_mpio = malloc(sizeof(mpio_t)); if (!new_mpio) { debug ("Error allocating memory for mpio_t"); + _mpio_errno = MPIO_ERR_OUT_OF_MEMORY; return NULL; } memset(new_mpio, 0, sizeof(mpio_t)); + new_mpio->fd=0; if (mpio_device_open(new_mpio) != MPIO_OK) { + free(new_mpio); _mpio_errno = MPIO_ERR_DEVICE_NOT_READY; return NULL; } -- cgit v1.2.3