index 793724fd52063157545f523f6d88953b96385c2c..c2641ddefdfde5ccb08af900ac48378231f969c7 100644 (file)
--- a/entry.c
+++ b/entry.c
-#include <sys/types.h>
-#include <dirent.h>
#include "cache.h"
#include "blob.h"
#include "cache.h"
#include "blob.h"
return error("git-checkout-index: unable to create file %s (%s)",
path, strerror(errno));
}
return error("git-checkout-index: unable to create file %s (%s)",
path, strerror(errno));
}
- wrote = write(fd, new, size);
+ /* FIXME: LF -> CRLF conversion goes here, based on "ce->name" */
+ wrote = write_in_full(fd, new, size);
close(fd);
free(new);
if (wrote != size)
close(fd);
free(new);
if (wrote != size)
@@ -106,7 +105,7 @@ static int write_entry(struct cache_entry *ce, char *path, struct checkout *stat
return error("git-checkout-index: unable to create "
"file %s (%s)", path, strerror(errno));
}
return error("git-checkout-index: unable to create "
"file %s (%s)", path, strerror(errno));
}
- wrote = write(fd, new, size);
+ wrote = write_in_full(fd, new, size);
close(fd);
free(new);
if (wrote != size)
close(fd);
free(new);
if (wrote != size)
@@ -135,7 +134,7 @@ static int write_entry(struct cache_entry *ce, char *path, struct checkout *stat
int checkout_entry(struct cache_entry *ce, struct checkout *state, char *topath)
{
int checkout_entry(struct cache_entry *ce, struct checkout *state, char *topath)
{
- static char path[MAXPATHLEN+1];
+ static char path[PATH_MAX + 1];
struct stat st;
int len = state->base_dir_len;
struct stat st;
int len = state->base_dir_len;
@@ -172,5 +171,3 @@ int checkout_entry(struct cache_entry *ce, struct checkout *state, char *topath)
create_directories(path, state);
return write_entry(ce, path, state, 0);
}
create_directories(path, state);
return write_entry(ce, path, state, 0);
}
-
-