diff options
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -16,10 +16,31 @@ * along with this program. If not, see <https://www.gnu.org/licenses/>. */ +#include <aio.h> +#include <errno.h> +#include <stdio.h> #include <stdlib.h> +#include <string.h> int main(void) { - int ret = EXIT_SUCCESS; + int ret = EXIT_FAILURE; + struct aio *aio = aio_open("/media/cdrom/", "rb"); + + if (!aio) + { + fprintf(stderr, "%s: aio_open failed: %s\n", __func__, strerror(errno)); + goto end; + } + + ret = EXIT_SUCCESS; + +end: + if (aio && aio_close(aio)) + { + fprintf(stderr, "%s: aio_close failed: %s\n", __func__, strerror(errno)); + ret = EXIT_FAILURE; + } + return ret; } |
