search for: ignore_value

Displaying 20 results from an estimated 143 matches for "ignore_value".

2018 Apr 27
3
[libvirt] ignore_value
Hi,using ignore_value in libvirt source code to do function return value processing,but I can’t understand about it,can you give me some tips?thanks very much!
2018 Apr 27
0
Re: [libvirt] ignore_value
On 04/27/2018 02:20 AM, gaosheng cui wrote: > Hi,using ignore_value in libvirt source code > to do function return value processing,but I > can’t understand about it,can you give me some tips?thanks very much! Is your question about what ignore_value() does? It exists solely to shut up compiler warnings about anything declared with __attribute__((warn_unuse...
2016 Jun 22
1
Re: [PATCH 1/4] p2v: use yast2 lan on SUSE distros rather than NM
...; There's an informal ordering for header files, and putting <sys/stat.h> at the very top isn't in that tradition! > @@ -654,7 +655,11 @@ test_connection_ok (gpointer user_data) > static void > configure_network_button_clicked (GtkWidget *w, gpointer data) > { > - ignore_value (system ("nm-connection-editor &")); > + struct stat statbuf; > + if (stat ("/sbin/yast2", &statbuf) >= 0) > + ignore_value (system ("yast2 lan &")); > + else > + ignore_value (system ("nm-connection-editor &")); Ho...
2017 Mar 30
4
[PATCH 0/3] p2v, v2v: Ensure the full version is always available in several places.
After debugging a virt-p2v issue with a customer in the middle of the night on Tuesday, I felt it would have been helpful to know exactly which version(s) of virt-p2v and virt-v2v they were using. That wasn't very clear from the log file I was provided with, so this change makes sure the information is included every time. Rich.
2016 Apr 14
0
[PATCH 1/2] utils, builder: Add wrappers for posix_fadvise.
...builder/pxzcat-c.c +++ b/builder/pxzcat-c.c @@ -214,10 +214,7 @@ pxzcat (value filenamev, value outputfilev, unsigned nr_threads) unix_error (err, (char *) "ftruncate", outputfilev); } -#if defined HAVE_POSIX_FADVISE - /* Tell the kernel we won't read the output file. */ - ignore_value (posix_fadvise (fd, 0, 0, POSIX_FADV_RANDOM|POSIX_FADV_DONTNEED)); -#endif + guestfs_int_fadvise_noreuse (fd); /* Iterate over blocks. */ iter_blocks (idx, nr_threads, filenamev, fd, outputfilev, ofd); diff --git a/src/guestfs-internal-frontend.h b/src/guestfs-internal-frontend.h index 7f1...
2016 Apr 13
1
[PATCH v2 libguestfs] launch: Implement a safer getumask.
...;fork"); + close (fd[0]); + close (fd[1]); + return -1; + } + if (pid == 0) { + /* The child process must ONLY call async-safe functions. */ + close (fd[0]); + + mask = umask (0); + if (mask == -1) { + str = "umask: "; + err = strerror (errno); + ignore_value (write (2, str, strlen (str))); + ignore_value (write (2, err, strlen (err))); + _exit (EXIT_FAILURE); + } + + if (write (fd[1], &mask, sizeof mask) != sizeof mask) { + str = "write: "; + err = strerror (errno); + ignore_value (write (2, str, strlen (str...
2016 Apr 14
3
builder: posix_fadvise fixes.
The way we used posix_fadvise was wrong, and yet right! Rich.
2018 Jan 22
2
[PATCH] lua, perl: Use thread-safe strerror_r instead of strerror (RHBZ#1536763).
..._lua_create (lua_State *L) return luaL_error (L, \"Guestfs.create: too many arguments\"); g = guestfs_create_flags (flags); - if (!g) - return luaL_error (L, \"Guestfs.create: cannot create handle: %%s\", - strerror (errno)); + if (!g) { + ignore_value (strerror_r (errno, err, sizeof err)); + return luaL_error (L, \"Guestfs.create: cannot create handle: %%s\", err); + } guestfs_set_error_handler (g, NULL, NULL); @@ -226,6 +230,7 @@ error__tostring (lua_State *L) { int code; const char *msg; + char err[128]; lua_p...
2016 May 12
0
[PATCH 3/4] appliance: Move code for creating supermin appliance directory to tmpdirs.c.
...afe_asprintf (g, "%s/lock", cachedir); + cachedir = guestfs_int_lazy_make_supermin_appliance_dir (g); + if (cachedir == NULL) + return -1; + appliancedir = safe_asprintf (g, "%s/appliance.d", cachedir); + lockfile = safe_asprintf (g, "%s/lock", cachedir); - ignore_value (mkdir (cachedir, 0755)); - ignore_value (chmod (cachedir, 0755)); /* RHBZ#921292 */ - - /* See if the cache directory exists and passes some simple checks - * to make sure it has not been tampered with. - */ - if (lstat (cachedir, &statbuf) == -1) - return 0; - if (statbuf.st_uid !=...
2016 Jun 22
0
[PATCH 1/4] p2v: use yast2 lan on SUSE distros rather than NM
...-51,6 +51,7 @@ #include <config.h> +#include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <stdarg.h> @@ -654,7 +655,11 @@ test_connection_ok (gpointer user_data) static void configure_network_button_clicked (GtkWidget *w, gpointer data) { - ignore_value (system ("nm-connection-editor &")); + struct stat statbuf; + if (stat ("/sbin/yast2", &statbuf) >= 0) + ignore_value (system ("yast2 lan &")); + else + ignore_value (system ("nm-connection-editor &")); } /** -- 2.6.6
2016 Jun 22
0
[PATCH v3 1/4] p2v: use yast2 lan on SUSE distros rather than NM
...| 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/p2v/gui.c b/p2v/gui.c index e720002..f8605a3 100644 --- a/p2v/gui.c +++ b/p2v/gui.c @@ -654,7 +654,10 @@ test_connection_ok (gpointer user_data) static void configure_network_button_clicked (GtkWidget *w, gpointer data) { - ignore_value (system ("nm-connection-editor &")); + if (access ("/sbin/yast2", X_OK) >= 0) + ignore_value (system ("yast2 lan &")); + else + ignore_value (system ("nm-connection-editor &")); } /** -- 2.6.6
2018 Nov 06
2
Re: [PATCH v2 2/2] p2v: add a Shutdown action (RHBZ#1642044)
On Tue, Nov 06, 2018 at 12:51:30PM +0100, Pino Toscano wrote: > +static void > +shutdown_clicked (GtkWidget *w, gpointer data) > +{ > + if (!is_iso_environment) > + return; > + > + sync (); > + sleep (2); > + ignore_value (system ("/sbin/shutdown now")); > +} I've tested this and it works but of course it doesn't in fact power off the machine. Would it be better to run "/sbin/poweroff" instead? Anyway, either way ACK series, thanks. Rich. -- Richard Jones, Virtualization Group, R...
2018 Nov 06
2
Re: [PATCH 2/2] p2v: add a Shutdown action (RHBZ#1642044)
On Mon, Nov 05, 2018 at 06:31:25PM +0100, Pino Toscano wrote: > +static void > +shutdown_clicked (GtkWidget *w, gpointer data) > +{ > + if (!is_iso_environment) > + return; > + > + sync (); > + sleep (2); > + ignore_value (system ("/sbin/shutdown")); > +} > + The shutdown button doesn't actually work[1]. I don't know why because /sbin/shutdown exists. Rich. [1] Using ‘make -C p2v run-virt-p2v-in-a-vm’ -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read...
2014 Nov 28
2
[PATCH] lib: Add COMPILE_REGEXP macro to hide regexp constructors/destructors.
...*err; \ + int offset; \ + name = pcre_compile ((pattern), (options), &err, &offset, NULL); \ + if (name == NULL) { \ + ignore_value (write (2, err, strlen (err))); \ + abort (); \ + } \ + } \ + static void...
2015 Dec 02
3
[PATCH] daemon: improve internal commandrvf
...close (0); if (flag_copy_stdin) { - dup2 (flag_copy_fd, STDIN_FILENO); + if (dup2 (flag_copy_fd, STDIN_FILENO) == -1) { + perror ("dup2/flag_copy_fd"); + _exit (EXIT_FAILURE); + } } else { - /* Set stdin to /dev/null (ignore failure) */ - ignore_value (open ("/dev/null", O_RDONLY|O_CLOEXEC)); + /* Set stdin to /dev/null. */ + if (open ("/dev/null", O_RDONLY) == -1) { + perror ("open(/dev/null)"); + _exit (EXIT_FAILURE); + } } close (so_fd[PIPE_READ]); close (se_fd[PIPE_REA...
2012 Dec 13
2
[PATCH 1/2] daemon: NFC Use symbolic names in commandrvf
...lag_copy_stdin) { - dup2 (stdin_fd[0], 0); - close (stdin_fd[0]); - close (stdin_fd[1]); + dup2 (stdin_fd[PIPE_READ], STDIN_FILENO); + close (stdin_fd[PIPE_READ]); + close (stdin_fd[PIPE_WRITE]); } else { /* Set stdin to /dev/null (ignore failure) */ ignore_value (open ("/dev/null", O_RDONLY|O_CLOEXEC)); } - close (so_fd[0]); - close (se_fd[0]); + close (so_fd[PIPE_READ]); + close (se_fd[PIPE_READ]); if (!(flags & COMMAND_FLAG_FOLD_STDOUT_ON_STDERR)) - dup2 (so_fd[1], 1); + dup2 (so_fd[PIPE_WRITE], STDOUT_FILENO...
2016 Mar 20
0
[PATCH] conn: Pretend to be a serial terminal, so sgabios doesn't hang.
...back a fake console + * size. + */ + if (memmem (buf, n, dsr_request, sizeof dsr_request - 1) != NULL) { + /* Ignore any error from this write, as it's just an optimization. + * We can't even be sure that console_sock is a socket or that + * it's writable. + */ + ignore_value (write (conn->console_sock, dsr_reply, + sizeof dsr_reply - 1)); + /* Additionally, because of a bug in sgabios, it will still pause + * unless you write at least 14 bytes, so we have to pad the + * reply. We can't pad with NULs since sgabios's input r...
2016 Mar 22
0
[PATCH v3 05/11] conn: Pretend to be a serial terminal, so sgabios doesn't hang.
...back a fake console + * size. + */ + if (memmem (buf, n, dsr_request, sizeof dsr_request - 1) != NULL) { + /* Ignore any error from this write, as it's just an optimization. + * We can't even be sure that console_sock is a socket or that + * it's writable. + */ + ignore_value (write (conn->console_sock, dsr_reply, + sizeof dsr_reply - 1)); + /* Additionally, because of a bug in sgabios, it will still pause + * unless you write at least 14 bytes, so we have to pad the + * reply. We can't pad with NULs since sgabios's input r...
2017 Apr 24
1
Re: [PATCH v7 1/7] daemon: expose file upload logic
On Sun, Apr 23, 2017 at 07:49:56PM +0300, Matteo Cafasso wrote: > + if (r == -1) { /* write error */ > + err = errno; > + r = cancel_receive (); You need to use ignore_value here, and it needs to be in a separate commit, as discussed previously. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with...
2018 Nov 06
1
Re: [PATCH v2 2/2] p2v: add a Shutdown action (RHBZ#1642044)
...M +0100, Pino Toscano wrote: > > > +static void > > > +shutdown_clicked (GtkWidget *w, gpointer data) > > > +{ > > > + if (!is_iso_environment) > > > + return; > > > + > > > + sync (); > > > + sleep (2); > > > + ignore_value (system ("/sbin/shutdown now")); > > > +} > > > > I've tested this and it works but of course it doesn't in fact power > > off the machine. Would it be better to run "/sbin/poweroff" instead? > > Hm shutdown by default does poweroff, a...