From b6b96b96b42b8fbc78837772e72d2ce3bbe781aa Mon Sep 17 00:00:00 2001 From: dschmenk Date: Tue, 4 Feb 2014 15:28:36 -0800 Subject: [PATCH] Fix FUSE create() Fix return code when creating new file --- .gitignore | 2 ++ Makefile | 2 +- debian/changelog | 5 +++++ src/fusea2pi.c | 2 +- src/gpclk.c | 10 +++++++++- 5 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index cba7efc..43bb9f2 100755 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ a.out + +src/gpclk diff --git a/Makefile b/Makefile index bb15270..05d05e0 100755 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PACKAGE=a2pi -VERSION=0.1.7 +VERSION=0.1.8 DIST=$(PACKAGE)-$(VERSION) DISTDIR=./$(DIST) diff --git a/debian/changelog b/debian/changelog index 2b99b5f..92a80df 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,8 @@ +a2pi (0.1.8-0) unstable; urgency=low + + * Fix FUSE create file function + + -- David Schmenk Tue, 04 Feb 2014 13:43:53 -0800 a2pi (0.1.7-3) unstable; urgency=low * Adjust file permissions for FUSE driver to allow group access diff --git a/src/fusea2pi.c b/src/fusea2pi.c index 51f98bf..a790fa2 100755 --- a/src/fusea2pi.c +++ b/src/fusea2pi.c @@ -1262,7 +1262,7 @@ static int a2pi_create(const char * path, mode_t mode, struct fuse_file_info *fi { err = prodos_map_errno(prodos_create(prodos_name, 0xC3, type, aux, 0)); } - if (refnum == 0) + else if (refnum > 0) { prodos_set_eof(refnum, 0); prodos_close(refnum, &io_buff); diff --git a/src/gpclk.c b/src/gpclk.c index c34af6e..1892283 100755 --- a/src/gpclk.c +++ b/src/gpclk.c @@ -99,4 +99,12 @@ void gpclk(int idiv) release_io(gpio); release_io(cmgp); } - +#ifndef SETSERCLK +int main(void) +{ + /* + * Initialize ACIA clock for Apple II Pi card + */ + gpclk(271); /* divisor for ~1.8 MHz => (500/271) MHz */ +} +#endif