Rename ->{pre,post}_select methods to ->{pre,post}_monitor. The word "monitor" is neutral and continues to be correct after the switch from select(2) to poll(2). Pure rename, nothing to see here.
Misc documentation cleanups related to select(). Assorted comment cleanups which avoid to talk about select(2) and fd sets. No code changes.
Hide implementation of para_fd_set(). This preparatory patch for replacing select() renames para_fd_set() to sched_fd_set(), moves it to sched.c and makes it static. All users are modified to call either of the two new public functions sched_monitor_{read,write}fd() which take a pointer to struct sched rather than an fd set pointer.
fd: Drop fd_set parameter from read_nonblock() and friends. This parameter is not necessary because its only purpose is to avoid the readv(2) system call in case it would likely return EAGAIN because we just called select(2) which reported that there is no data to read. Since the parameter is an obstacle for the conversion of the code base from select(2) to poll(2), get rid of it for the time being. If needed we can add back an equivalent optimization which checks for POLLIN after the conversion.
Shorten copyright notice. The GPLv2 line does not add any additional information, so drop it. This leaves a single line of legalese text for most files, which is about the amount of screen real estate it deserves. This patch was created with the following script (plus some manual fixups): awk '{ if (NR <= 5) { gs = gensub(/.*Copyright.* ([0-9]+).*Andre Noll.*/, "\\1", "g") if (gs != $0) year = gs next } if (NR == 6 && year != "") printf("/* Copyright (C) %s Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */\n", year) print }'
signal.h: Add documentation of signal_pre_select(). It is a public function which should be annotated.
Improve signal init and shutdown. Currently all users of the signal subsystem define their own signal_task structure and initialize the ->fd field from the return value of para_signal_init(). It is more natural to let the signal subsystem perform the allocation and the initialization. This commit renames para_signal_init() to signal_init_or_die() and changes the function to allocate, initialize and return a signal task structure (rather than only the file descriptor of the signal pipe as para_signal_init() did). Similarly, para_signal_shutdown() is renamed to signal_shutdown() and now takes a pointer to the signal_task structure which was obtained in an earlier call to signal_init_or_die(), and frees it. Conversion of all users is straight forward. The patch also adds a missing call to signal_shutdown() to audiod.c, closing an fd leak.
signal: Provide generic signal_pre_select(). Identical copies of this function exist in afs.c, gui.c, audiod.c and server.c. This commit defines a generic version as an inline function in signal.h and gets rid of the copies.
Update year in copyright headers. Done with files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2014\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2014 Andre Noll/Copyright (C) \1 Andre Noll/1' $files In previous years we ran a similar script to set the second year in the range to the current year. This is kind of silly, so let's get rid of this useless information. This commit replaces "Copyright (C) A-B" by "Copyright (C) A" in all file headers, i.e. only the first year (A) is left in. Accurate information including time stamps for each change can be obtained from the git history.
doc: Change email address to maan@tuebingen.mpg.de The mail server on systemlinux.org was down for more than a week lately, so let's use an alternative official address. This commit changes all maan@systemlinux.org addresses to maan@tuebingen.mpg.de. Most .c and .h files contain the email address in the copyright header, so they must all be patched. Three other files contain the address for a different reason: * README lists email and git, gitweb and home page URLs * configure.ac needs it for configure -h * version.c contains it for the -V option of all commands
task_register() conversion: signal task
Change copyright year to 2014. This year, we're really on time. The changes in this patch were created by the following silly script: files=$(git grep -l 'Copyright (C) [0-9]\{4\}\(-2013\)* Andre Noll') sed --in-place= -e 's/Copyright (C) \([0-9]\{4\}\)-2013 Andre Noll/Copyright (C) \1-2014 Andre Noll/1' $files sed --in-place= -e 's/Copyright (C) 2013 Andre Noll/Copyright (C) 2013-2014 Andre Noll/1' $files
Change copyright year to 2013. Better late than never.
Change year in copyright message to 2012.
server: Kill temporary SIGCHLD handler. During startup, para_server sets up a temporary signal handler for SIGCHLD in order to notice if the afs child process terminates immediately (doing the signal setup after the fork would be too late). This patch makes it block this signal during this period instead. This works equally well and it fixes a weird problem on Mac OS where the temporary SIGCHLD handler was executed although it had been replaced by the generic signal handler of signal.c.
Replace 2010 in copyright message by 2011.
Use non-blocking API for signal handling. This gets rid of a couple of calls to FD_ISSET() and simplifies para_next_signal() a bit.
Remove ->signum from struct signal_task. It is only needed in the signal handlers where a local variable can be used instead.
Change year in COPYRIGHT to 2010. Hey, this is earlier than last year :)
Kill unused para_reap_children(). Found by cppcheck.