+++ /dev/null
-(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
#include<file.h>
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;
}