Displaying 11 results from an estimated 11 matches for "rc_listen".
Did you mean:
_listen
2009 Sep 11
1
[PATCH] guestfish: Redirect stdout when executing remote commands
...stdout fd");
+ exit (1);
+ }
+}
+
+static void
+close_stdout (void)
+{
+ int fd;
+
+ fd = open ("/dev/null", O_WRONLY);
+ if (fd == -1)
+ perror ("/dev/null");
+ else {
+ dup2 (fd, STDOUT_FILENO);
+ close (fd);
+ }
+}
+
/* Remote control server. */
void
rc_listen (void)
@@ -56,7 +175,7 @@ rc_listen (void)
char sockpath[128];
pid_t pid;
struct sockaddr_un addr;
- int sock, s, i, fd;
+ int sock, s, i;
FILE *fp;
XDR xdr, xdr2;
guestfish_hello hello;
@@ -111,13 +230,7 @@ rc_listen (void)
/* Now close stdout and substitute /dev/null. This...
2009 Aug 21
9
enable -Werror and all of gcc's warning options
Here is a bunch of small patches to make fish/ build
with most warnings enabled:
[1/9] edit.c: avoid warning about signed/unsigned comparison
[2/9] fish.c: avoid warnings
[3/9] tilde.c: avoid a warning
[4/9] fish.c: avoid "assignment discards qualifiers..." warning
[5/9] fish.c: avoid signed/unsigned-comparison warning
[6/9] fish.c: don't perform arithmetic on void*
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...program_name);
- exit (1);
+ exit (EXIT_FAILURE);
}
if (file) {
fprintf (stderr,
_("%s: cannot use --listen and --file options at the same time\n"),
program_name);
- exit (1);
+ exit (EXIT_FAILURE);
}
rc_listen ();
}
@@ -425,7 +425,7 @@ main (int argc, char *argv[])
close (0);
if (open (file, O_RDONLY) == -1) {
perror (file);
- exit (1);
+ exit (EXIT_FAILURE);
}
}
@@ -441,7 +441,7 @@ main (int argc, char *argv[])
cleanup_readline ();
- exit (0);
+ exit (EXIT_S...
2009 Aug 24
5
[0/5] guestfish: detect stdout-write failure
Nearly any program that writes to standard output can
benefit from this sort of fix.
Without it, running e.g., ./guestfish --version > /dev/full
would exit successfully, even though it got ENOSPC
when writing to the full device. That means regular
output redirected to a file on a full partition may also
fail to be written, and the error ignored.
Before:
$ guestfish --version >
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...mptr);
*(int *)data = STDOUT_FILENO;
- if (sendmsg (s, &msg, 0) != 1) {
- perror ("sendmsg stdout fd");
- exit (EXIT_FAILURE);
- }
+ if (sendmsg (s, &msg, 0) != 1)
+ error (EXIT_FAILURE, errno, "sendmsg stdout fd");
}
static void
@@ -230,10 +221,8 @@ rc_listen (void)
create_sockdir ();
pid = fork ();
- if (pid == -1) {
- perror ("fork");
- exit (EXIT_FAILURE);
- }
+ if (pid == -1)
+ error (EXIT_FAILURE, errno, "fork");
if (pid > 0) {
/* Parent process. */
@@ -260,19 +249,13 @@ rc_listen (void)
creat...
2009 Nov 09
1
use STREQ(a,b), not strcmp(a,b) == 0
...d < argc && strcmp (argv[optind], ":") != 0)
+ while (optind < argc && STRNEQ (argv[optind], ":"))
optind++;
if (optind == argc) {
diff --git a/fish/rc.c b/fish/rc.c
index 182c4f4..a9eb578 100644
--- a/fish/rc.c
+++ b/fish/rc.c
@@ -250,7 +250,7 @@ rc_listen (void)
goto error;
}
- if (strcmp (hello.vers, PACKAGE_VERSION) != 0) {
+ if (STRNEQ (hello.vers, PACKAGE_VERSION)) {
fprintf (stderr, _("guestfish: protocol error: version mismatch, server version '%s' does not match client version '%s'. Th...
2010 Aug 31
13
[PATCH v2] Add progress bars
This is an updated and extended version of the original patch:
https://www.redhat.com/archives/libguestfs/2010-August/msg00163.html
This adds OCaml and Perl bindings (both tested), support for
progress bars in virt-resize, and adds progress notifications
to a number of the simpler commands.
Still to do is to add progress messages to more commands. There
are still a few commands which would be
2016 Apr 04
0
[PATCH 2/2] Use 'error' function for fprintf followed by exit.
...FAILURE);
- }
+ if (optind < argc)
+ error (EXIT_FAILURE, 0,
+ _("extra parameters on the command line with --listen flag"));
+ if (file)
+ error (EXIT_FAILURE, 0,
+ _("cannot use --listen and --file options at the same time"));
rc_listen ();
goto out_after_handle_close;
}
@@ -1055,10 +1036,8 @@ cmdline (char *argv[], size_t optind, size_t argc)
if (optind >= argc) return;
cmd = argv[optind++];
- if (STREQ (cmd, ":")) {
- fprintf (stderr, _("%s: empty command on command line\n"), guestfs_in...
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...ist all commands\n"),
- cmd);
+ cmd);
}
void
diff --git a/fish/fish.h b/fish/fish.h
index a65fe1b..772d200 100644
--- a/fish/fish.h
+++ b/fish/fish.h
@@ -80,7 +80,7 @@ extern int do_more (const char *cmd, int argc, char *argv[]);
/* in rc.c (remote control) */
extern void rc_listen (void);
extern int rc_remote (int pid, const char *cmd, int argc, char *argv[],
- int exit_on_error);
+ int exit_on_error);
/* in reopen.c */
extern int do_reopen (const char *cmd, int argc, char *argv[]);
diff --git a/fish/glob.c b/fish/glob.c
index 581bc28..2731b2f...
2017 Apr 04
1
[PATCH] Use Unicode single quotes ‘’ in place of short single quoted strings throughout.
...0700 ||
statbuf.st_uid != euid)
error (EXIT_FAILURE, 0,
- _("'%s' is not a directory or has insecure owner or permissions"),
+ _("‘%s’ is not a directory or has insecure owner or permissions"),
dir);
}
@@ -280,12 +280,12 @@ rc_listen (void)
xdrstdio_create (&xdr, fp, XDR_DECODE);
if (!xdr_guestfish_hello (&xdr, &hello)) {
- fprintf (stderr, _("guestfish: protocol error: could not read 'hello' message\n"));
+ fprintf (stderr, _("guestfish: protocol error: could not...
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers.
These aren't valid for global names in C++.
(http://stackoverflow.com/a/228797)
These large but completely mechanical patches change the illegal
identifiers to legal ones.
Rich.