#include <sys/socket.h>
#include <errno.h>
-void service(int fd_in, int fd_out) {
+static void service(int fd_in, int fd_out) {
ssize_t size;
int posn;
- char sha1[20];
+ char unsigned sha1[20];
unsigned long objsize;
void *buf;
do {
do {
size = read(fd_in, sha1 + posn, 20 - posn);
if (size < 0) {
- perror("rpush: read ");
+ perror("git-rpush: read ");
return;
}
if (!size)
buf = map_sha1_file(sha1, &objsize);
if (!buf) {
- fprintf(stderr, "rpush: could not find %s\n",
+ fprintf(stderr, "git-rpush: could not find %s\n",
sha1_to_hex(sha1));
return;
}
size = write(fd_out, buf + posn, objsize - posn);
if (size <= 0) {
if (!size) {
- fprintf(stderr, "rpush: write closed");
+ fprintf(stderr, "git-rpush: write closed");
} else {
- perror("rpush: write ");
+ perror("git-rpush: write ");
}
return;
}
arg++;
}
if (argc < arg + 2) {
- usage("rpush [-c] [-t] [-a] commit-id url");
+ usage("git-rpush [-c] [-t] [-a] commit-id url");
return 1;
}
commit_id = argv[arg];