When ssh 'broken pipe' error occurred, cvs quit exit error 0.

Here is my test script:

# cat opencvs.sh
#!/bin/ksh

cd /usr/src
echo "[`/bin/date "+%Y-%m-%dT%H:%M:%S%z"`] start cvs update /usr/src/"
while true; do
    cvs -q -d [email protected]:/cvs up -Pd
    rc=$?
    echo $rc
    if [ "$rc" -eq "0" ]; then
        break;
    fi
    echo "[`/bin/date "+%Y-%m-%dT%H:%M:%S%z"`] retry cvs update"
done
echo "[`/bin/date "+%Y-%m-%dT%H:%M:%S%z"`] done cvs update"

# ksh opencvs.sh
[2016-05-21T01:16:47+0800] start cvs update /usr/src/
P bin/pax/ar_io.c
P bin/pax/ftree.c
P bin/rmdir/rmdir.c
P distrib/armv7/ramdisk/install.md
P distrib/sets/lists/man/mi
P etc/examples/bgpd.conf
P share/man/man4/Makefile
U share/man/man4/utvfu.4
P sys/dev/pci/if_iwm.c
P sys/dev/pci/if_iwn.c
P sys/kern/kern_sched.c
P sys/ufs/ext2fs/ext2fs_alloc.c
P sys/ufs/ext2fs/ext2fs_balloc.c
P usr.sbin/bgpctl/bgpctl.c
P usr.sbin/bgpd/bgpd.conf.5
P usr.sbin/bgpd/bgpd.h
P usr.sbin/bgpd/parse.y
P usr.sbin/bgpd/rde.c
P usr.sbin/bgpd/rde_filter.c
P usr.sbin/bgpd/util.c
P usr.sbin/pstat/pstat.8
P usr.sbin/pstat/pstat.c
packet_write_wait: Connection to 206.51.28.2 port 22: Broken pipe
0
[2016-05-21T01:26:28+0800] done cvs update

Reply via email to