| Commit message (Collapse) | Author | Age |
| |
|
|
|
| |
This is shorter and conveys enough information. Rename the static para_exec()
as well.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In para_exec(), the parent does not detect errors that occur in the child
after the call to fork() succeeded. This includes the common error case
where the child's call to execvp() fails due to a path lookup error.
It is not difficult to implement error detection by introducing an additional
"control" pipe whose file descriptors are opened with O_CLOEXEC. If the
child's call to execvp() succeeds, the OS closes the descriptor and the
function does not return, Otherwise the descriptor remains open and execvp()
returns with errno set to indicate the error. In this case the child writes a
four byte representation of errno to the control pipe and exits. The parent
reads from the other end of the pipe. If the read returns zero, execvp()
succeeded. Otherwise, the parent has an error code to work with.
|
| |
|
|
|
| |
Drop some implementation details and describe the semantics of the pid
pointer in the error case.
|
| |
|
|
|
| |
Currently para_exec() ignores all errors from dup2(). Introduce xdup2()
to teach para_exec() to abort on fatal errors and to retry on EINTR.
|
| |
|
|
|
|
| |
If para_exec() fails, it may return with or without writing through the pid
pointer. It's safer to initialize the pid at the beginning of the function
so that pid == 0 iff no process was created.
|
| |
|
|
| |
We return the error code, so the caller should act as it sees fit.
|
| |
|
|
|
|
|
|
| |
Generated with
sed -i 's|Copyright.*Andre Noll.*|SPDX-License-Identifier: GPL-2.0 */|g' *.c *.h
followed by manually tweaking the result a bit. No license change intended.
|
| |
|
|
| |
Every .c file includes it anyway.
|
| |
|
|
|
| |
Clarify the documentation of the public para_exec_cmdline_pid()
and dedox the static para_exec().
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a command is executed as a display command from para_gui, and
the command is interrupted from within para_gui by pressing any key,
para_gui only kills the spawned process but leaves alone its child
processes.
Address this problem by putting the spawned process into a separate
process group so that we can easily kill all processes of the group
by passing the negated PID of the child to kill(2).
In theory, the change in exec.c also affects para_mixer, which executes
para_client and para_audioc. However, para_mixer never kills any of
its child processes.
|
| |
|
|
| |
The new code is equivalent, but a bit shorter.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
}'
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Quite a few..
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
| |
Better late than never.
|
| |
|
|
| |
It does not depend on it.
|
| | |
|
| |
|
|
|
|
|
|
| |
This gets rid of quite some inclusions of <dirent.h> which are not needed
as most .c files do not deal with directories at all.
afs.c doe not mmap anything and needs nothing from sys/time.h so remove
these includes as well.
|
| | |
|
| |
|
|
| |
Hey, this is earlier than last year :)
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
A wrapper for regcomp() that logs an error message if the regcomp() failed
and uses a return value according to the paraslash rules. Currently there is
only one user of regular expressions, is_v4_dot_quad(), which is converted
to para_regex(), but new callers will be added soon.
Unfortunately, this change made it necessary to include regex.h in all .c files
that use string.h. Clean up the order in which headers are included a bit while
we're at it.
Maybe I should rethink the rule "Only .c files shall include header files"...
|
| |
|
|
|
|
|
|
|
| |
The latter function is superior as it honors quotes and special characters like '\n'.
This allows for example to use whitespace characters in mood methods.
Fixup and simplify all callers accordingly.
The patch broke the grab command of para_audiod which is deactivated ATM and
will be fixed in a subsequent patch.
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
| |
Just to prevent external programs from getting confused when they write
to fd 1 or 2.
|
| |
|
|
|
|
| |
para_fade and para_gui, the only two users of exec.o, do not care
about the close on fork list. So do not link close_on_fork.o into
these executables.
|
| |
|
|
|
|
| |
Use para_open in exec.c and add error logging.
fade.c: Add proper error return values and error checking.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
The new type,
char * const * const argv
is what the exec functions also take. This avoids some
warnings.
|
| | |
|
| |
|
|
|
|
|
|
| |
Thanks to Lorenzo Bettini for pointing this out.
This patch also fixes a bug with the default filter configuration which
allocated too little memory for the array of filter configurations. Now
we always allocate space for at least three entries.
|
| |
|
|
|
| |
ATM, they only contain the file_exists() function which was pulled
out from exec.c. More to follow.
|
| | |
|
|
|
Let's try if this works out.
|