git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rename internal functions.
[libguestfs.git]
/
daemon
/
guestfsd.c
diff --git
a/daemon/guestfsd.c
b/daemon/guestfsd.c
index
ef28d9b
..
49aca08
100644
(file)
--- a/
daemon/guestfsd.c
+++ b/
daemon/guestfsd.c
@@
-41,6
+41,7
@@
#include <sys/wait.h>
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/wait.h>
#include <arpa/inet.h>
#include <netinet/in.h>
+#include <errno.h>
#ifdef HAVE_PRINTF_H
# include <printf.h>
#ifdef HAVE_PRINTF_H
# include <printf.h>
@@
-543,16
+544,23
@@
add_string (char ***argv, int *size, int *alloc, const char *str)
return 0;
}
return 0;
}
-
in
t
+
size_
t
count_strings (char *const *argv)
{
count_strings (char *const *argv)
{
-
in
t argc;
+
size_
t argc;
for (argc = 0; argv[argc] != NULL; ++argc)
;
return argc;
}
for (argc = 0; argv[argc] != NULL; ++argc)
;
return argc;
}
+/* http://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2 */
+int
+is_power_of_2 (unsigned long v)
+{
+ return v && ((v & (v - 1)) == 0);
+}
+
static int
compare (const void *vp1, const void *vp2)
{
static int
compare (const void *vp1, const void *vp2)
{
@@
-758,20
+766,20
@@
commandrvf (char **stdoutput, char **stderror, int flags,
*/
if (pipe (so_fd) == -1 || pipe (se_fd) == -1) {
*/
if (pipe (so_fd) == -1 || pipe (se_fd) == -1) {
-
perror (
"pipe");
+
error (0, errno,
"pipe");
abort ();
}
if (flag_copy_stdin) {
if (pipe (stdin_fd) == -1) {
abort ();
}
if (flag_copy_stdin) {
if (pipe (stdin_fd) == -1) {
-
perror (
"pipe");
+
error (0, errno,
"pipe");
abort ();
}
}
pid = fork ();
if (pid == -1) {
abort ();
}
}
pid = fork ();
if (pid == -1) {
-
perror (
"fork");
+
error (0, errno,
"fork");
abort ();
}
abort ();
}
@@
-805,7
+813,7
@@
commandrvf (char **stdoutput, char **stderror, int flags,
stdin_pid = fork ();
if (stdin_pid == -1) {
stdin_pid = fork ();
if (stdin_pid == -1) {
-
perror (
"fork");
+
error (0, errno,
"fork");
abort ();
}
abort ();
}