| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
gettextize provides a local file called "gettext.h". Remove this and
use <libintl.h> from glibc headers instead.
Most of this change is mechanical: #include <libintl.h> in every C
file which uses any gettext function. But also we remove the
gettext.h file, and adjust the "_" macros.
Note that this effectively removes the ./configure --disable-nls
option, although we don't know if that ever worked.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The presumption is that all file descriptors should be created with
the close-on-exec flag set. The only exception are file descriptors
that we want passed through to exec'd subprocesses (mainly pipes and
stdin/stdout/stderr).
For open calls, we pass O_CLOEXEC as an extra flag, eg:
fd = open ("foo", O_RDONLY|O_CLOEXEC);
This is a Linux-ism, but using a macro we can easily make it portable.
For sockets, similarly:
sock = socket (..., SOCK_STREAM|SOCK_CLOEXEC, ...);
For accepted sockets, we use the Linux accept4 system call which
allows flags to be supplied, but we use the Gnulib 'accept4' module to
make this portable.
For dup, dup2, we use the Linux dup3 system call, and the Gnulib
modules 'dup3' and 'cloexec'.
|
|
|
|
|
| |
Analyze all uses of 'int' in the code, and replace with 'size_t' where
appropriate.
|
| |
|
|
|
|
|
| |
Return to the main program ('fish.c') and perform global cleanups when
the guestfish remote server exits.
|
|
|
|
| |
This is just code motion.
|
| |
|
|
|
|
|
| |
msg_flags was not being initialized and would have been passed to
sendmsg with a random value.
|
|
|
|
|
|
| |
Note that 'time' and 'glob' (which both run subcommands) do not
correctly pass the exit_on_error flag in the remote case. This is not
a regression: the current code doesn't work either.
|
|
|
|
| |
(Thanks Eric Blake).
|
|
|
|
|
|
|
| |
Don't depend on bash, but allow sh/dash/etc format:
GUESTFISH_PID=nn; export GUESTFISH_PID
(Thanks Eric Blake).
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Convert all uses automatically, via these two commands:
git grep -l '\<exit *(1)' \
| grep -vEf .x-sc_prohibit_magic_number_exit \
| xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(1\)/$1(EXIT_FAILURE)/'
git grep -l '\<exit *(0)' \
| grep -vEf .x-sc_prohibit_magic_number_exit \
| xargs --no-run-if-empty \
perl -pi -e 's/\b(exit ?)\(0\)/$1(EXIT_SUCCESS)/'
* .x-sc_prohibit_magic_number_exit: New file.
Edit (RWMJ): Don't change Java code.
|
|
|
|
|
| |
git grep -l 'strcmp *([^=]*!= *0'|xargs \
perl -pi -e 's/\bstrcmp( *\(.*?\)) *!= *0\b/STRNEQ$1/g'
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
guestfish --listen necessarily redirects its stdout to /dev/null so as not to
interfere with eval. The remote protocol doesn't contain any other provision for
collecting stdout for the caller, so executing guestfish --remote will never
generate any output.
This patch fixes that by forwarding the caller's STDOUT to the listener over the
unix socket connection. The listener redirects its STDOUT to the caller's STDOUT
for the duration of the command, then closes it again.
|
|
|
|
|
| |
* fish/rc.c (UNIX_PATH_MAX): Remove unused definition.
* fish/fish.h (rc_listen): Declare with __attribute__((noreturn)).
|
|
|
|
|
|
|
| |
* fish/rc.c (rc_remote): Close file handle only *after* xdr_destroy,
because that latter may flush its file handle (implicated via
xdrstdio_create). FYI, this failure is triggered for me only when
MALLOC_PERTURB_ is set to nonzero < 256 in my environment.
|
|
|
|
|
|
|
|
|
|
|
| |
Do it by running this command:
[exempted files are matched via .x-sc_TAB_in_indentation]
git ls-files \
| pcregrep -vf .x-sc_TAB_in_indentation \
| xargs pcregrep -l '^ *\t' \
| xargs perl -MText::Tabs -ni -le \
'$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
|
|
The use case is to have a long-running guestfish process in
a shell script, and thus to avoid the overhead of starting
guestfish each time. Do:
eval `guestfish --listen`
guestfish --remote somecmd
guestfish --remote someothercmd
guestfish --remote exit
This patch also supports having multiple guestfish processes
at the same time.
The protocol is simple XDR messages over a Unix domain socket.
|