]> git.proxmox.com Git - libgit2.git/blobdiff - src/hashsig.c
New upstream version 1.1.0+dfsg.1
[libgit2.git] / src / hashsig.c
index bea5383493233747d0452f0ecfe7af04131e970a..14ec34b2f01683744f6c012478da06f2d3d04a28 100644 (file)
@@ -4,8 +4,11 @@
  * This file is part of libgit2, distributed under the GNU GPL v2 with
  * a Linking Exception. For full terms see the included COPYING file.
  */
+
+#include "common.h"
+
 #include "git2/sys/hashsig.h"
-#include "fileops.h"
+#include "futils.h"
 #include "util.h"
 
 typedef uint32_t hashsig_t;
@@ -213,7 +216,7 @@ static int hashsig_finalize_hashes(git_hashsig *sig)
 {
        if (sig->mins.size < HASHSIG_HEAP_MIN_SIZE &&
                !(sig->opt & GIT_HASHSIG_ALLOW_SMALL_FILES)) {
-               giterr_set(GITERR_INVALID,
+               git_error_set(GIT_ERROR_INVALID,
                        "file too small for similarity signature calculation");
                return GIT_EBUFS;
        }
@@ -246,7 +249,7 @@ int git_hashsig_create(
        int error;
        hashsig_in_progress prog;
        git_hashsig *sig = hashsig_alloc(opts);
-       GITERR_CHECK_ALLOC(sig);
+       GIT_ERROR_CHECK_ALLOC(sig);
 
        hashsig_in_progress_init(&prog, sig);
 
@@ -273,7 +276,7 @@ int git_hashsig_create_fromfile(
        int error = 0, fd;
        hashsig_in_progress prog;
        git_hashsig *sig = hashsig_alloc(opts);
-       GITERR_CHECK_ALLOC(sig);
+       GIT_ERROR_CHECK_ALLOC(sig);
 
        if ((fd = git_futils_open_ro(path)) < 0) {
                git__free(sig);
@@ -285,7 +288,7 @@ int git_hashsig_create_fromfile(
        while (!error) {
                if ((buflen = p_read(fd, buf, sizeof(buf))) <= 0) {
                        if ((error = (int)buflen) < 0)
-                               giterr_set(GITERR_OS,
+                               git_error_set(GIT_ERROR_OS,
                                        "read error on '%s' calculating similarity hashes", path);
                        break;
                }