CVSROOT: /cvs Module name: src Changes by: schwa...@cvs.openbsd.org 2021/09/01 08:28:15
Modified files: usr.bin/vi/cl : cl.h cl_funcs.c cl_main.c cl_read.c Log message: As a first step towards safe signal handling, improve the h_int() and h_winch() signal handlers to make one single store to a sig_atomic_t variable. Note that the h_hup() and h_term() signal handlers are still unsafe after this commit because they also set the "killersig" (how fitting!) field in a global struct. Despite storing information in static global variables rather than in structs passed around as arguments, this patch does not cause a change in behaviour because there is always exactly one GS object, initialized using gs_init() called from the top of main(), and screen_init() stores a pointer to this one and only GS object in the .gp member of each and every SCR object. Talk about useless abstraction... Problem pointed out by deraadt@. Patch from Tim <trondd at kagu hyphen tsuchi dot com> on tech@. OK deraadt@.