diff --git a/contrib/release-scripts/release.sh b/contrib/release-scripts/release.sh index 8352f6f..4ceff53 100755 --- a/contrib/release-scripts/release.sh +++ b/contrib/release-scripts/release.sh @@ -22,6 +22,7 @@ mkdir -p out SV=mkp224o-$V SO=$(realpath ./out/$SV) git clone ../../ "$SO" +git -C ../../ diff | git -C "$SO" apply cd "$SO" rm -rf .git ./autogen.sh diff --git a/ioutil.c b/ioutil.c index 6ec260a..5d1edca 100644 --- a/ioutil.c +++ b/ioutil.c @@ -221,22 +221,29 @@ int createdir(const char *path,int secret) static int syncwritefile(const char *filename,const char *tmpname,int secret,const u8 *data,size_t datalen) { FH f = createfile(tmpname,secret); - if (f == FH_invalid) + if (f == FH_invalid) { + //fprintf(stderr,"!failed to create\n"); return -1; + } + if (writeall(f,data,datalen) < 0) { + //fprintf(stderr,"!failed to write\n"); goto failclose; } if (FlushFileBuffers(f) == 0) { + //fprintf(stderr,"!failed to flush\n"); goto failclose; } if (closefile(f) < 0) { + //fprintf(stderr,"!failed to close\n"); goto failrm; } - if (MoveFileA(tmpname,filename) == 0) { + if (MoveFileExA(tmpname,filename,MOVEFILE_REPLACE_EXISTING) == 0) { + //fprintf(stderr,"!failed to move\n"); goto failrm; }