From: alex Date: Fri, 24 Mar 2023 04:43:08 +0000 (-0700) Subject: guix manifest upgrade and bug fixes X-Git-Tag: v1.0.3^0 X-Git-Url: http://git.infiniteadaptability.org/?a=commitdiff_plain;h=HEAD;p=events guix manifest upgrade and bug fixes --- diff --git a/.gitignore b/.gitignore index 24a31b4..737de46 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ config.h.in~ config.log config.status configure +configure~ configure.scan Makefile Makefile.in diff --git a/events.scm b/events.scm deleted file mode 100644 index 9520ceb..0000000 --- a/events.scm +++ /dev/null @@ -1,39 +0,0 @@ -(define-module (infiniteadaptability packages events) - #:use-module (gnu packages autotools) - #:use-module (gnu packages gcc) - #:use-module (gnu packages sqlite) - #:use-module (guix git-download) - #:use-module (guix build-system gnu) - #:use-module (guix licenses) - #:use-module (guix packages)) - -(define-public events - (let ((version "1.1.0") - (commit "1ac4b76c722fb3764a3a366663ae689030a1b49e") - (revision 0)) - (package - (name "events") - (version (if (zero? revision) version - (string-append version "-" - (number->string revision) "." - (string-take commit 7)))) - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://git.infiniteadaptability.org/events.git") - (commit commit))) - (sha256 - (base32 - "01lvncpw3ajikn6mz3ni2himaa1056p3b7prfhx494kiqdizpikf")) - (file-name (string-append "events-" version "-checkout")))) - (build-system gnu-build-system) - (arguments - (list #:parallel-tests? #f)) - (native-inputs `(("autoconf" ,autoconf) - ("automake" ,automake))) - (home-page "https://git.infiniteadaptability.org/events") - (synopsis "utility for managing events") - (description "command-line utility for managing events.") - (license unlicense)))) - -events diff --git a/inc/args.h b/inc/args.h index ebda10b..21f5a2d 100644 --- a/inc/args.h +++ b/inc/args.h @@ -17,6 +17,6 @@ enum sub_command { SUB_COMMAND_VALIDATE }; -int args(int,char**); +enum sub_command args(int,char**); #endif diff --git a/manifest.scm b/manifest.scm new file mode 100644 index 0000000..59adb3b --- /dev/null +++ b/manifest.scm @@ -0,0 +1,7 @@ +(specifications->manifest (list "gcc-toolchain" + "autoconf" + "automake" + "make" + "gdb" + "universal-ctags" + "valgrind")) diff --git a/src/file/mv.c b/src/file/mv.c index 688ab97..22506b7 100644 --- a/src/file/mv.c +++ b/src/file/mv.c @@ -1,10 +1,26 @@ #include int file_move(const char *tempname) { - if(rename(tempname,global_options.file)==-1) { - perror("rename"); + FILE *src, *to; + + src = fopen(tempname, "r"); + if(NULL==src) { + perror("fopen"); + return -1; + } + + to = fopen(global_options.file, "w"); + if(NULL==to) { + perror("fopen"); return -1; } + if(file_pipe(to, src)<0) { return -1; } + + if(fclose(src)!=0) { return -1; } + if(fclose(to)!=0) { return -1; } + + if(remove(tempname)!=0) { return -1; } + return 1; }