--- configure.in.orig 2004-10-01 02:35:56.000000000 +1000 +++ configure.in @@ -447,6 +447,11 @@ AC_CHECK_FUNCS(waitpid wait4 getcwd strd strlcat strlcpy strtol mallinfo getgroups setgroups geteuid getegid \ open64 mkstemp64) +AC_CHECK_FUNCS(getpgrp) +if test $ac_cv_func_getpgrp = yes; then + AC_FUNC_GETPGRP +fi + AC_CACHE_CHECK([for working socketpair],rsync_cv_HAVE_SOCKETPAIR,[ AC_TRY_RUN([ #include --- config.h.in.orig 2004-08-03 07:54:49.000000000 +1000 +++ config.h.in @@ -12,6 +12,9 @@ this is either `int' or `gid_t'. */ #undef GETGROUPS_T +/* Define if the `getpgrp' function takes no argument. */ +#undef GETPGRP_VOID + /* Define to 1 if you have `alloca', as a function or macro. */ #undef HAVE_ALLOCA @@ -89,6 +92,9 @@ /* Define to 1 if you have the `getnameinfo' function. */ #undef HAVE_GETNAMEINFO +/* Define if you have the getpgrp function. */ +#undef HAVE_GETPGRP + /* */ #undef HAVE_GETTIMEOFDAY_TZ --- progress.c.orig 2004-02-28 13:00:57.000000000 +1100 +++ progress.c @@ -115,10 +115,19 @@ void end_progress(OFF_T size) void show_progress(OFF_T ofs, OFF_T size) { struct timeval now; + static pid_t pgrp = -1; if (am_server) return; + if (pgrp == -1) { +#if GETPGRP_VOID + pgrp = getpgrp(); +#else /* ! GETPGRP_VOID */ + pgrp = getpgrp(0); +#endif /* ! GETPGRP_VOID */ + } + gettimeofday(&now, NULL); if (!ph_start.time.tv_sec) { @@ -150,5 +159,8 @@ void show_progress(OFF_T ofs, OFF_T size ph_list[newest_hpos].ofs = ofs; } + if (tcgetpgrp(fileno(stdout)) != pgrp) + return; + rprint_progress(ofs, size, &now, False); }