Skip to content

Instantly share code, notes, and snippets.

@shulima
shulima / program-name.patch
Last active August 29, 2015 14:17
Change program_name to avoid collision with gnulib
diff --git a/align/scan.c b/align/scan.c
index e803d8e..4740581 100644
--- a/align/scan.c
+++ b/align/scan.c
@@ -71,7 +71,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
- program_name);
+ guestfs___program_name);
@shulima
shulima / lcrypt.patch
Last active August 29, 2015 14:17
Check whether lcrypt comes from a separate library
diff --git a/builder/Makefile.am b/builder/Makefile.am
index f6225a6..4f64f0b 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
@@ -172,7 +172,7 @@ OCAMLCLIBS = \
-L../src/.libs -lutils \
-L../gnulib/lib/.libs -lgnu \
-pthread -lpthread \
- $(LIBTINFO_LIBS) -lcrypt
+ $(LIBTINFO_LIBS) $(LIBCRYPT_LIBS)
@shulima
shulima / posix_fadvise.patch
Created March 25, 2015 22:23
Check if POSIX_FADVISE exists before using it
diff --git a/builder/pxzcat-c.c b/builder/pxzcat-c.c
index 42610c0..17886d6 100644
--- a/builder/pxzcat-c.c
+++ b/builder/pxzcat-c.c
@@ -208,8 +208,10 @@ pxzcat (value filenamev, value outputfilev, unsigned nr_threads)
unix_error (err, "ftruncate", outputfilev);
}
+#if defined HAVE_POSIX_FADVISE
/* Tell the kernel we won't read the output file. */
@shulima
shulima / fuse-bsd.patch
Last active August 29, 2015 14:17
Replace Linux-specific fuse commands
diff --git a/fuse/guestunmount.c b/fuse/guestunmount.c
index 3df481b..94c3ec7 100644
--- a/fuse/guestunmount.c
+++ b/fuse/guestunmount.c
@@ -257,7 +257,12 @@ do_fusermount (const char *mountpoint, char **error_rtn)
/* We have to parse error messages from fusermount, so ... */
setenv ("LC_ALL", "C", 1);
+#ifdef __linux__
execlp ("fusermount", "fusermount", "-u", mountpoint, NULL);
@shulima
shulima / java_doclint.patch
Created March 25, 2015 22:26
Turn off doclint to allow Java bindings to compile.
diff --git a/java/Makefile.am b/java/Makefile.am
index b0296b3..d89c9c4 100644
--- a/java/Makefile.am
+++ b/java/Makefile.am
@@ -68,7 +68,7 @@ clean-local:
if HAVE_JAVA
JAVAC_FLAGS = $(EXTRA_JAVAC_FLAGS) -encoding utf-8
-JAVADOC_FLAGS = -encoding utf-8
+JAVADOC_FLAGS = -encoding utf-8 -Xdoclint:none
@shulima
shulima / xdrproc_t.patch
Created March 25, 2015 22:27
Add third parameter to xdrproc_t callbacks
diff --git a/src/proto.c b/src/proto.c
index 8001c8c..53d1d6b 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -252,7 +252,7 @@ guestfs___send (guestfs_h *g, int proc_nr,
* have no parameters.
*/
if (xdrp) {
- if (!(*xdrp) (&xdr, args)) {
+ if (!(*xdrp) (&xdr, args, 0)) {
@shulima
shulima / getprogname.patch
Last active August 29, 2015 14:17
Use getprogname where available
diff --git a/configure b/configure
index 61c715d..1724ba2 100755
--- a/configure
+++ b/configure
@@ -50323,6 +50323,7 @@ for ac_func in \
be32toh \
fsync \
futimens \
+ getprogname \
getxattr \
@shulima
shulima / byteswap.patch
Created March 25, 2015 22:29
Add MacOSX-specific byteswap defines
diff --git a/src/inspect-apps.c b/src/inspect-apps.c
index 836a160..8bf7073 100644
--- a/src/inspect-apps.c
+++ b/src/inspect-apps.c
@@ -35,11 +35,22 @@
#include <sys/endian.h>
#endif
-/* be32toh is usually a macro definend in <endian.h>, but it might be
+/* be32toh is usually a macro defined in <endian.h>, but it might be
@shulima
shulima / sock_defines.patch
Created March 25, 2015 22:30
SOCK_* defines
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index aaa8501..7ca56cd 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -28,6 +28,7 @@
#include <grp.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <sys/un.h>
#include <sys/wait.h>
@shulima
shulima / ruby_dlext.patch
Created March 25, 2015 22:31
Look up DLEXT instead of assuming .so
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index f605188..d28d77b 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -21,6 +21,8 @@ generator_built = \
ext/guestfs/_guestfs.c \
bindtests.rb
+DLEXT := $(shell $(RUBY) -rrbconfig -e "puts RbConfig::CONFIG['DLEXT']")
+