summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9f1915d)
raw | patch | inline | side by side (parent: 9f1915d)
author | Heikki Orsila <heikki.orsila@iki.fi> | |
Sun, 27 Apr 2008 18:21:58 +0000 (21:21 +0300) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 30 Apr 2008 06:11:57 +0000 (23:11 -0700) |
xread() and xwrite() return ssize_t values as their native POSIX
counterparts read(2) and write(2).
To be consistent, read_in_full() and write_in_full() should also return
ssize_t values.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
counterparts read(2) and write(2).
To be consistent, read_in_full() and write_in_full() should also return
ssize_t values.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | patch | blob | history | |
path.c | patch | blob | history | |
refs.c | patch | blob | history | |
write_or_die.c | patch | blob | history |
index 3fcc2830029feb82223f2c82c424c7ea09fdd0b4..5a28dddec931f983a4aeff2ee7129444d07e07aa 100644 (file)
--- a/cache.h
+++ b/cache.h
extern void maybe_flush_or_die(FILE *, const char *);
extern int copy_fd(int ifd, int ofd);
extern int copy_file(const char *dst, const char *src, int mode);
-extern int read_in_full(int fd, void *buf, size_t count);
-extern int write_in_full(int fd, const void *buf, size_t count);
+extern ssize_t read_in_full(int fd, void *buf, size_t count);
+extern ssize_t write_in_full(int fd, const void *buf, size_t count);
extern void write_or_die(int fd, const void *buf, size_t count);
extern int write_or_whine(int fd, const void *buf, size_t count, const char *msg);
extern int write_or_whine_pipe(int fd, const void *buf, size_t count, const char *msg);
index 2ae7cd997555883ecbe73b12fb53c1e6c650b62c..b7c24a2aacf87ffea6bd6380dbff44e5d317b240 100644 (file)
--- a/path.c
+++ b/path.c
struct stat st;
char *buf, buffer[256];
unsigned char sha1[20];
- int len, fd;
+ int fd;
+ ssize_t len;
if (lstat(path, &st) < 0)
return -1;
index 1b0050eee4e037aec8396edd0ff6c14bda5985a2..4db73ed8f01200fca4008bafb23bda36a8e23446 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -368,7 +368,8 @@ int resolve_gitlink_ref(const char *path, const char *refname, unsigned char *re
const char *resolve_ref(const char *ref, unsigned char *sha1, int reading, int *flag)
{
- int depth = MAXDEPTH, len;
+ int depth = MAXDEPTH;
+ ssize_t len;
char buffer[256];
static char ref_buffer[256];
diff --git a/write_or_die.c b/write_or_die.c
index e125e11d3b63e3dab9077d7b414e83e7ff7d16ad..32f99140205f8969d8a884b3cf9448eec3f1dd16 100644 (file)
--- a/write_or_die.c
+++ b/write_or_die.c
}
}
-int read_in_full(int fd, void *buf, size_t count)
+ssize_t read_in_full(int fd, void *buf, size_t count)
{
char *p = buf;
ssize_t total = 0;
return total;
}
-int write_in_full(int fd, const void *buf, size_t count)
+ssize_t write_in_full(int fd, const void *buf, size_t count)
{
const char *p = buf;
ssize_t total = 0;