[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

e2fsprogs patch for review (and other stuff)



Hi,

Triggered by the following statement on IRC wrt the build failure of the
latest e2fprogs:

07:13:31< youpi> I wonder when gnu_srs will realize that most of his
questions can simply be answered "lack of manpower",

I created the attached patch for e2fsprogs_1.42~WIP-2011-10-01-2. All
packages builds OK, but has not yet been run tested. Comments are
welcomed!

A few observations.
1) It seems that more and more code becoming is Linux specific. People
don't seem to care about portability :-(
2) Many Debian maintainers don't seem to care about other arches like
Hurd/kFreeBSD either. Is there something that can be made to improve
this situation.
3) Maybe more frequent releases of gnumach/hurd/eglibc could be created.
Maybe using experimental would be a good idea?

Furthermore:
Even if Samuel creates the build summaries like summary.txt and
graph-total-top.txt there is no priority list on which packages are most
important to concentrate on. Such a list would be very useful for people
working with package porting.
diff -ur e2fsprogs-1.42~WIP-2011-10-01/e2fsck/sigcatcher.c e2fsprogs-1.42~WIP-2011-10-01.modified//e2fsck/sigcatcher.c
--- e2fsprogs-1.42~WIP-2011-10-01/e2fsck/sigcatcher.c	2011-09-29 04:05:13.000000000 +0200
+++ e2fsprogs-1.42~WIP-2011-10-01.modified//e2fsck/sigcatcher.c	2011-10-04 14:30:52.000000000 +0200
@@ -131,6 +131,7 @@
 	END_TABLE
 };
 
+#ifdef __linux__
 static struct str_table generic_code_table[] = {
 	DEFINE_ENTRY(SI_ASYNCNL)
 	DEFINE_ENTRY(SI_TKILL)
@@ -143,6 +144,16 @@
 	DEFINE_ENTRY(SI_KERNEL)
 	END_TABLE
 };
+#else
+static struct str_table generic_code_table[] = {
+	DEFINE_ENTRY(SI_ASYNCIO)
+	DEFINE_ENTRY(SI_MESGQ)
+	DEFINE_ENTRY(SI_TIMER)
+	DEFINE_ENTRY(SI_QUEUE)
+	DEFINE_ENTRY(SI_USER)
+	END_TABLE
+};
+#endif
 
 static struct str_table sigill_code_table[] = {
 #ifdef ILL_ILLOPC
diff -ur e2fsprogs-1.42~WIP-2011-10-01/lib/quota/mkquota.c e2fsprogs-1.42~WIP-2011-10-01.modified//lib/quota/mkquota.c
--- e2fsprogs-1.42~WIP-2011-10-01/lib/quota/mkquota.c	2011-09-18 20:06:52.000000000 +0200
+++ e2fsprogs-1.42~WIP-2011-10-01.modified//lib/quota/mkquota.c	2011-10-04 15:25:26.000000000 +0200
@@ -51,9 +51,13 @@
 	char tmp[1024];
 	qid_t id = (type == USRQUOTA) ? getuid() : getgid();
 
+#ifndef __GNU__
 	if (!quotactl(QCMD(Q_V2_GETQUOTA, type), fs->device_name, id, tmp))
 		return 1;
 	return 0;
+#else
+	return 1;
+#endif
 }
 
 /*
diff -ur e2fsprogs-1.42~WIP-2011-10-01/lib/quota/quotaio.c e2fsprogs-1.42~WIP-2011-10-01.modified//lib/quota/quotaio.c
--- e2fsprogs-1.42~WIP-2011-10-01/lib/quota/quotaio.c	2011-09-29 00:34:41.000000000 +0200
+++ e2fsprogs-1.42~WIP-2011-10-01.modified//lib/quota/quotaio.c	2011-10-04 14:50:03.000000000 +0200
@@ -7,6 +7,7 @@
 
 #include "config.h"
 #include <stdio.h>
+#include <assert.h>
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
@@ -55,7 +56,11 @@
 const char *get_qf_name(int type, int fmt, char *buf)
 {
 	BUG_ON(!buf);
-	snprintf(buf, PATH_MAX, "%s.%s",
+	int len;
+	len = strlen(basenames[fmt]) + 1 + strlen(extensions[type]) + 1;
+	if( (buf = malloc(len)) == NULL)
+		 assert(buf);
+	snprintf(buf, len, "%s.%s",
 		 basenames[fmt], extensions[type]);
 
 	return buf;
@@ -65,7 +70,7 @@
 			char *path_buf, size_t path_buf_size)
 {
 	struct stat	qf_stat;
-	char qf_name[PATH_MAX] = {0};
+	char *qf_name = NULL;
 
 	BUG_ON(!mntpt);
 	BUG_ON(!path_buf);
@@ -262,7 +267,6 @@
 	int fd = 0;
 	ext2_file_t e2_file;
 	const char *mnt_fsname;
-	char qf_name[PATH_MAX];
 	int err;
 	struct ext2_inode inode;
 	unsigned long qf_inum;

Reply to: