Displaying 4 results from an estimated 4 matches for "receive_stdout".
2009 Sep 11
1
[PATCH] guestfish: Redirect stdout when executing remote commands
...sys/socket.h>
#include <rpc/types.h>
#include <rpc/xdr.h>
@@ -49,6 +50,124 @@ create_sockpath (pid_t pid, char *sockpath, int len, struct sockaddr_un *addr)
strcpy (addr->sun_path, sockpath);
}
+static const socklen_t controllen = CMSG_LEN (sizeof (int));
+
+static void
+receive_stdout (int s)
+{
+ static struct cmsghdr *cmptr = NULL, *h;
+ struct msghdr msg;
+ struct iovec iov[1];
+
+ /* Our 1 byte buffer */
+ char buf[1];
+
+ if (NULL == cmptr) {
+ cmptr = malloc (controllen);
+ if (NULL == cmptr) {
+ perror ("malloc");
+ exit (1...
2009 Nov 20
1
fix new failures from latest-from-gnulib syntax-check
...onst char *str)
if (NULL == argv_new) {
perror ("realloc");
free_n_strings (argv, argv_len-1);
- exit (1);
+ exit (EXIT_FAILURE);
}
argv = argv_new;
diff --git a/fish/rc.c b/fish/rc.c
index a9eb578..dbaf953 100644
--- a/fish/rc.c
+++ b/fish/rc.c
@@ -66,7 +66,7 @@ receive_stdout (int s)
cmptr = malloc (controllen);
if (NULL == cmptr) {
perror ("malloc");
- exit (1);
+ exit (EXIT_FAILURE);
}
}
@@ -88,7 +88,7 @@ receive_stdout (int s)
ssize_t n = recvmsg (s, &msg, 0);
if (n < 0) {
perror ("recvmsg stdout fd...
2017 Mar 03
14
[PATCH 00/11] Various Coverity fixes
Hi,
this patch series fixes some issues discovered by Coverity.
Most of them are memory leaks, usually on error; there are also invalid
memory access issues.
Thanks,
Pino Toscano (11):
java: link libguestfs_jni against libutils
java: fix invalid memory access for FBuffer in struct lists
daemon: tsk: properly use GUESTFS_MAX_CHUNK_SIZE
edit: fix small memory leak on error
java: fix
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...amp;& errno != EEXIST) {
+ if (r == -1 && errno != EEXIST)
error:
- perror (dir);
- exit (EXIT_FAILURE);
- }
+ error (EXIT_FAILURE, errno, "%s", dir);
if (lstat (dir, &statbuf) == -1)
goto error;
if (!S_ISDIR (statbuf.st_mode) ||
@@ -99,10 +98,8 @@ receive_stdout (int s)
if (NULL == cmptr) {
cmptr = malloc (controllen);
- if (NULL == cmptr) {
- perror ("malloc");
- exit (EXIT_FAILURE);
- }
+ if (NULL == cmptr)
+ error (EXIT_FAILURE, errno, "malloc");
}
/* Don't specify a source */
@@ -122,10...