aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 09c1f21..99d4c95 100644
--- a/src/main.c
+++ b/src/main.c
@@ -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;
}