Package: jfsutils
Version: 1.1.8-1.hurdfr.1
Severity: normal
Tags: patch
jfsutils has some portability issues that I needed to fix for GNU/Hurd.
With this patch, the utils work fine on GNU/Hurd and GNU/Linux.
I noticed xpeek doesn't get installed, so perhaps it should be disabled?
diff -Nurp jfsutils-1.1.8/config.h.in jfsutils-1.1.8.patched/config.h.in
--- jfsutils-1.1.8/config.h.in 2005-05-03 21:43:31.000000000 +0200
+++ jfsutils-1.1.8.patched/config.h.in 2006-01-23 16:38:32.000000000 +0100
@@ -55,6 +55,9 @@
/* Define to 1 if you have the <sys/byteorder.h> header file. */
#undef HAVE_SYS_BYTEORDER_H
+/* Define to 1 if you have the <sys/mount.h> header file. */
+#undef HAVE_SYS_MOUNT_H
+
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
diff -Nurp jfsutils-1.1.8/configure.in jfsutils-1.1.8.patched/configure.in
--- jfsutils-1.1.8/configure.in 2005-05-03 21:41:39.000000000 +0200
+++ jfsutils-1.1.8.patched/configure.in 2006-01-23 16:38:17.000000000 +0100
@@ -18,7 +18,7 @@ AC_PROG_RANLIB
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(endian.h fcntl.h mntent.h unistd.h stdbool.h stdint.h
machine/endian.h sys/byteorder.h)
+AC_CHECK_HEADERS(endian.h fcntl.h mntent.h unistd.h stdbool.h stdint.h
machine/endian.h sys/byteorder.h sys/mount.h)
AC_CHECK_HEADERS(uuid/uuid.h,,AC_MSG_ERROR('You need the uuid library'))
dnl Checks for typedefs, structures, and compiler characteristics.
diff -Nurp jfsutils-1.1.8/libfs/devices.c jfsutils-1.1.8.patched/libfs/devices.c
--- jfsutils-1.1.8/libfs/devices.c 2005-03-16 19:09:28.000000000 +0100
+++ jfsutils-1.1.8.patched/libfs/devices.c 2006-01-23 16:01:01.000000000
+0100
@@ -18,7 +18,11 @@
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
+
+#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
+#endif
+
#include <sys/types.h>
#include <sys/stat.h>
#include "jfs_types.h"
@@ -320,5 +324,9 @@ int ujfs_flush_dev(int fd)
if (fsync(fd) == -1)
return errno;
+#ifdef BLKFLSBUF
return ioctl(fd, BLKFLSBUF, 0);
+#else
+ return 0;
+#endif
}
diff -Nurp jfsutils-1.1.8/mkfs/initmap.c jfsutils-1.1.8.patched/mkfs/initmap.c
--- jfsutils-1.1.8/mkfs/initmap.c 2005-05-03 21:21:42.000000000 +0200
+++ jfsutils-1.1.8.patched/mkfs/initmap.c 2006-01-23 16:24:22.000000000
+0100
@@ -1118,11 +1118,14 @@ int verify_last_blocks(int dev_ptr, int
memset(buffer, 0, bufsize);
nbufblks = bufsize / aggr_block_size;
+#ifdef O_DIRECT
/*
* Must do direct-io to avoid the page cache
*/
flags = fcntl(dev_ptr, F_GETFL);
+
fcntl(dev_ptr, F_SETFL, flags | O_DIRECT);
+#endif
/*
* Starting from the last allocated block to the end of the aggregate
@@ -1186,9 +1189,10 @@ int verify_last_blocks(int dev_ptr, int
}
if (error != 0) {
+#ifdef O_DIRECT
/* add_bad_block may do unaligned I/O */
fcntl(dev_ptr, F_SETFL, flags);
-
+#endif
/* Add this block to bad list */
if ((rc =
add_bad_block(dev_ptr, thisblk,
@@ -1196,8 +1200,10 @@ int verify_last_blocks(int dev_ptr, int
bb_inode)))
continue;
write_inode = true;
+#ifdef O_DIRECT
fcntl(dev_ptr, F_SETFL,
flags | O_DIRECT);
+#endif
/*
* In case we allocated blocks for our
@@ -1227,8 +1233,9 @@ int verify_last_blocks(int dev_ptr, int
nblocks -= nb;
}
}
+#ifdef O_DIRECT
fcntl(dev_ptr, F_SETFL, flags);
-
+#endif
msg_parms[0] = "100";
message_user(MSG_OSO_PERCENT_FORMAT, msg_parms, 1, OSO_MSG);
fprintf(stdout, "\n");
diff -Nurp jfsutils-1.1.8/xpeek/directory.c
jfsutils-1.1.8.patched/xpeek/directory.c
--- jfsutils-1.1.8/xpeek/directory.c 2004-07-22 16:25:08.000000000 +0200
+++ jfsutils-1.1.8.patched/xpeek/directory.c 2006-01-23 16:26:56.000000000
+0100
@@ -48,7 +48,7 @@ char display_extent_page(int64_t);
void display_xtpage(xtpage_t *);
void strToUcs(UniChar *, char *, int);
-char UTF8_Buffer[8 * PATH_MAX];
+char UTF8_Buffer[8 * JFS_PATH_MAX];
void directory()
{
@@ -648,7 +648,7 @@ char display_slot(struct dtslot *slot, i
memset(UTF8_Buffer, 0, sizeof (UTF8_Buffer));
/* Convert the name into UTF8 */
- Unicode_String_to_UTF8_String(UTF8_Buffer, slot[index].name, PATH_MAX);
+ Unicode_String_to_UTF8_String(UTF8_Buffer, slot[index].name,
JFS_PATH_MAX);
printf("[3] name\t%.15s\n", UTF8_Buffer);
-- System Information:
Debian Release: testing/unstable
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: hurd-i386 (i686-AT386)
Shell: /bin/sh linked to /bin/bash
Kernel: GNU 0.3
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Versions of packages jfsutils depends on:
ii libc0.3 2.3.5-6 GNU C Library: Shared libraries an
ii libuuid1 1.38+1.39-WIP-2005.12.31-1 universally unique id library
jfsutils recommends no packages.
-- no debconf information
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]