write_in_full: really write in full or return error on disk full.
[gitweb.git] / path.c
diff --git a/path.c b/path.c
index d2c076d7cbad3a16a002897d926cc13633be4f77..bb5ee7bf99780b6c4069dd9833994b24f1577e82 100644 (file)
--- a/path.c
+++ b/path.c
@@ -11,7 +11,6 @@
  * which is what it's designed for.
  */
 #include "cache.h"
-#include <pwd.h>
 
 static char bad_path[] = "/bad-path/";
 
@@ -114,7 +113,7 @@ int validate_symref(const char *path)
        fd = open(path, O_RDONLY);
        if (fd < 0)
                return -1;
-       len = read(fd, buffer, sizeof(buffer)-1);
+       len = read_in_full(fd, buffer, sizeof(buffer)-1);
        close(fd);
 
        /*