Re: active translators stdout/stderr

2016-02-21 Thread Ludovic Courtès
Richard Braun  skribis:

> On Sun, Feb 14, 2016 at 10:09:37PM +0100, Samuel Thibault wrote:
>> Hello,
>> 
>> We have various issues with the active translators' stdout/stderr:
>> 
>> - When mounting /proc from /etc/init.d/rc, stdout/stderr is closed, and
>>   thus as soon as e.g. mtab reports a warning, it gets SIGLOST and dies.
>> - When mounting the cdrom image from debian installer scripts, the
>>   script is not considered finished since the isofs translator is still
>>   running and possibly emitting output.
>> 
>> So, what should we do about stdout/stderr output?  Do we require their
>> output to be explicitly redirected by callers of mount and settrans?
>> In the mount case, people used to Linux will not think of doing it, so
>> perhaps we need it to do it for the user?
>
> I think we could have a default log server for that. We could make it
> a gsoc project. It should make a good entry project.

In the meantime I suppose /dev/null would make for a good log server,
and it’s presumably a simple fix?

Ludo’.




[PATCH] fix Xioctl-proto.defs creation

2016-02-21 Thread Bartlomiej Puget
---
Hi,

I had little problems generating Xioctl-proto.defs. After looking into
the code and few little changes scripts has worked.

Please, check my patch. If I was doing something wrong, please tell me,
but I think that the script was the problem here:

  - in Xioctl-values.symc.o asterisk can be preceded by spaces / tabs

  - when creating Xioctl-requests.list, last asterisk is not escaped

  - gensym.awk puts newlines after '__asm ("' what is interpreted as
an error later

Cheers

 hurd/Makefile   | 4 ++--
 hurd/gensym.awk | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/hurd/Makefile b/hurd/Makefile
index 4273ff3..2902d47 100644
--- a/hurd/Makefile
+++ b/hurd/Makefile
@@ -58,7 +58,7 @@ hurd.msgids: $(patsubst %.defs,%.msgids,$(filter 
%.defs,$(INSTHDRS)))
 %.symc.o: %.symc
$(CC) -S $(CPPFLAGS) $(CFLAGS) $(CPPFLAGS-$@) -x c -o $@ $<
 %.h: %.symc.o
-   sed <$< -e 's/^[^*].*$$//' | \
+   sed <$< -e 's/^[[:space:]]*//' -e 's/^[^*].*$$//' | \
sed -e 's/^[*]/#define/' -e 's/mAgIc[^-0-9]*//' -e '/^ *$$/d' >$@
 
 %-ioctls.sym: tmpl-ioctls.sym
@@ -69,7 +69,7 @@ cpp = $(CC) $(CPPFLAGS) $(CFLAGS) $(CPPFLAGS-$@) -E -x c
 %ioctl-requests.list: %ioctl-headers.h
$(cpp) $< | sed -n 's/^#.*"\([^"]*\)".*$$/\1/p' | sort | uniq | \
while read f; do \
- sed -n 's/^[  ]*#[]*define[   
]*\([A-Z0-9_]*\)[^A-Z0-9_][^A-Z0-9_]*_IO.*'\'$*\'.*$$'/\1/p' $$f; \
+ sed -n 's/^[  ]*#[]*define[   
]*\([A-Z0-9_]*\)[^A-Z0-9_][^A-Z0-9_]*_IO.*'\'$*\''.*$$/\1/p' $$f; \
done | sort | uniq > $@
 
 %ioctl.defs: %ioctl.sym
diff --git a/hurd/gensym.awk b/hurd/gensym.awk
index 6c6e1a1..e5157c3 100644
--- a/hurd/gensym.awk
+++ b/hurd/gensym.awk
@@ -34,7 +34,7 @@ BEGIN {
 
 # Take an arbitrarily complex C symbol or expression and constantize it.
 /^expr/ {
-   print "__asm (\"";
+   printf "__asm (\"";
if ($3 == "")
printf "* %s mAgIc%%0\" : : \"i\" (%s));\n", $2, $2;
else
@@ -43,7 +43,7 @@ BEGIN {
 
 # Output a symbol defining the size of a C structure.
 /^size/ {
-   print "__asm (\"";
+   printf "__asm (\"";
if ($4 == "")
printf "* %s_SIZE mAgIc%%0\" : : \"i\" (sizeof(struct %s)));\n",
toupper($3), $2;
@@ -54,7 +54,7 @@ BEGIN {
 
 # Output a symbol defining the byte offset of an element of a C structure.
 /^offset/ {
-   print "__asm (\"";
+   printf "__asm (\"";
if ($5 == "")
{
printf "* %s_%s mAgIc%%0\" : : \"i\" (&((struct 
%s*)0)->%s));\n",
-- 
2.4.10


-- 
Bartłomiej Puget


signature.asc
Description: Digital signature