X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=rpush.c;h=17d5ab8a60ab2ec7fa3a7dc927351e8a34de3a89;hb=d6db01075b65da2b8584a0450619390893aae103;hp=0293a1a46311d7e20b13177143741ab9d6d0d201;hpb=6eb7ed5403b7d57d5ed7e30d0cd0b312888ee95c;p=git.git diff --git a/rpush.c b/rpush.c index 0293a1a4..17d5ab8a 100644 --- a/rpush.c +++ b/rpush.c @@ -3,10 +3,10 @@ #include #include -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 { @@ -14,7 +14,7 @@ void service(int fd_in, int fd_out) { do { size = read(fd_in, sha1 + posn, 20 - posn); if (size < 0) { - perror("rpush: read "); + perror("git-rpush: read "); return; } if (!size) @@ -26,7 +26,7 @@ void service(int fd_in, int fd_out) { 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; } @@ -35,9 +35,9 @@ void service(int fd_in, int fd_out) { 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; } @@ -56,12 +56,12 @@ int main(int argc, char **argv) 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]; url = argv[arg + 1]; - if (setup_connection(&fd_in, &fd_out, "rpull", url, arg, argv + 1)) + if (setup_connection(&fd_in, &fd_out, "git-rpull", url, arg, argv + 1)) return 1; service(fd_in, fd_out);