Thread: pgsql: Clean up psql's control-C handling to avoid longjmp'ing out of

pgsql: Clean up psql's control-C handling to avoid longjmp'ing out of

From
tgl@postgresql.org (Tom Lane)
Date:
Log Message:
-----------
Clean up psql's control-C handling to avoid longjmp'ing out of random
places --- that risks corrupting data structures, losing sync with the
backend, etc.  We now longjmp only from calls to readline, fgets, and
fread, which we assume are coded to protect themselves against interrupts
at undesirable times.  This requires adding explicit tests for
cancel_pressed in long-running loops, but on the whole it's far cleaner.
Martijn van Oosterhout and Tom Lane.

Modified Files:
--------------
    pgsql/src/bin/psql:
        common.c (r1.118 -> r1.119)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/common.c.diff?r1=1.118&r2=1.119)
        common.h (r1.49 -> r1.50)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/common.h.diff?r1=1.49&r2=1.50)
        copy.c (r1.65 -> r1.66)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/copy.c.diff?r1=1.65&r2=1.66)
        describe.c (r1.139 -> r1.140)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/describe.c.diff?r1=1.139&r2=1.140)
        input.c (r1.54 -> r1.55)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/input.c.diff?r1=1.54&r2=1.55)
        large_obj.c (r1.43 -> r1.44)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/large_obj.c.diff?r1=1.43&r2=1.44)
        mainloop.c (r1.79 -> r1.80)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/mainloop.c.diff?r1=1.79&r2=1.80)
        mainloop.h (r1.18 -> r1.19)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/mainloop.h.diff?r1=1.18&r2=1.19)
        print.c (r1.86 -> r1.87)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/print.c.diff?r1=1.86&r2=1.87)
        startup.c (r1.132 -> r1.133)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/startup.c.diff?r1=1.132&r2=1.133)
        variables.c (r1.23 -> r1.24)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/bin/psql/variables.c.diff?r1=1.23&r2=1.24)
    pgsql/src/port:
        sprompt.c (r1.16 -> r1.17)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/port/sprompt.c.diff?r1=1.16&r2=1.17)