bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: reloading domain


From: Bruno Haible
Subject: Re: reloading domain
Date: Mon, 27 Jul 2009 00:24:48 +0200
User-agent: KMail/1.9.9

Elan Ruusamäe wrote:
> > Yes, the .mo file is loaded with mmap, cached and kept open as long as the
> > process runs.
> > ...
> well. it doesn't work if the file is REPLACED
> ...
> #ifdef DELETE
>         system("rm "LOCALEDIR"/et/LC_MESSAGES/roke.mo");
> #endif
>         system("cp 2.mo "LOCALEDIR"/et/LC_MESSAGES/roke.mo");
> 
>         bindtextdomain(PACKAGE, "/");
>         bindtextdomain(PACKAGE, LOCALEDIR);

Yes, when a file is loaded with mmap, "cp" to the file is a recipe for
disaster. You have to use 'mv' or 'install', so that the new version of the
file gets a different inode number.

> (which is quite usual in `make install' case)... 

That's precisely the reason why 'make install' uses the 'install' program
or an 'install-sh' script, rather than 'cp'.

> ...like hacking _nl_domain_bindings symbol (it's visible in my glibc)

No, forget about that. There have been incompatible changes to this data
structure.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]