Re: [systemd-devel] [PATCH] sd-bus: export sd_bus_call{, _async, _async_cancel}

2014-02-11 Thread David Herrmann
Hi On Tue, Feb 11, 2014 at 3:31 AM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: On Mon, Feb 10, 2014 at 04:46:22PM +0100, David Herrmann wrote: The .sym file somehow lacks these declarations, so add these. You have to run make clean to make sure the sym-test runs fine afterwards.

Re: [systemd-devel] [PATCH] sd-bus: export sd_bus_call{, _async, _async_cancel}

2014-02-11 Thread Kay Sievers
On Tue, Feb 11, 2014 at 11:39 AM, David Herrmann dh.herrm...@gmail.com wrote: On Tue, Feb 11, 2014 at 3:31 AM, Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl wrote: On Mon, Feb 10, 2014 at 04:46:22PM +0100, David Herrmann wrote: The .sym file somehow lacks these declarations, so add these.

Re: [systemd-devel] Debian Bug#618862: systemd: ignores keyscript in crypttab - a possible solution

2014-02-11 Thread Lennart Poettering
On Sat, 08.02.14 21:07, David Härdeman (da...@hardeman.nu) wrote: On Wed, Feb 05, 2014 at 12:16:00AM +0100, Lennart Poettering wrote: On Thu, 30.01.14 10:40, David Härdeman (da...@hardeman.nu) wrote: This issue is fixable with minor upstream changes, e.g. by extending the PasswordAgent

[systemd-devel] Undefined reference efi_loader_get_boot_usec

2014-02-11 Thread Allmeroth, Robert
Hi, While crosscompiling to an embedded system I got the following error: systemd-208/.libs/libudev.so: undefined reference to `efi_loader_get_boot_usec' I helped myself to #ifdef the body of boot_timestamps() in shared/boot_timestamp.c Best regards Robert Configure: systemd 208

Re: [systemd-devel] Undefined reference efi_loader_get_boot_usec

2014-02-11 Thread Cristian Rodríguez
El 11/02/14 09:12, Allmeroth, Robert escribió: Hi, While crosscompiling to an embedded system I got the following error: systemd-208/.libs/libudev.so: undefined reference to `efi_loader_get_boot_usec' Ok, I think the attached patch should be applied to current HEAD. From

[systemd-devel] [PATCH] crash on suspend/resume ...

2014-02-11 Thread Michael Meeks
Hi Lennart, Great to see you, albeit too briefly at FOSDEM; my first ever systemd crash (on suspend/resume) after many moons of use turned out not to be a vendor patch but a core issue (well at least the crash part ;-). https://bugzilla.novell.com/show_bug.cgi?id=861488

Re: [systemd-devel] [PATCH] crash on suspend/resume ...

2014-02-11 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Feb 11, 2014 at 02:48:35PM +, Michael Meeks wrote: Hi Lennart, Great to see you, albeit too briefly at FOSDEM; my first ever systemd crash (on suspend/resume) after many moons of use turned out not to be a vendor patch but a core issue (well at least the crash part ;-).

[systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Jason A. Donenfeld
Hey folks, I'm using better-initramfs [1], a very small and minimal initrd that has been working very well for me. In switching to systemd, I found it necessary to have the initrd mount /run as tmpfs, according to the specs [2]. I made a little patch for better-initramfs, and now I'm talking to

Re: [systemd-devel] [PATCH 1/3] Add SELinuxContext configuration item

2014-02-11 Thread Daniel J Walsh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/07/2014 08:22 AM, Michael Scherer wrote: Le jeudi 06 février 2014 à 12:21 -0800, David Timothy Strauss a écrit : In order to maximize consistency with newly committed options in systemd-nspawn, would it make sense to allow independent

Re: [systemd-devel] [PATCH] crash on suspend/resume ...

2014-02-11 Thread Michael Meeks
On Tue, 2014-02-11 at 16:11 +0100, Zbigniew Jędrzejewski-Szmek wrote: Printing of the three arguments is supposed to be conditional on the same condtion (object != NULL). Anyway, in your backtrace: Fair enough =) #9 log_do_header (header=header@entry=0xbfeef2ec

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Dave Reisner
On Tue, Feb 11, 2014 at 04:32:56PM +0100, Jason A. Donenfeld wrote: Hey folks, I'm using better-initramfs [1], a very small and minimal initrd that has been working very well for me. In switching to systemd, I found it necessary to have the initrd mount /run as tmpfs, according to the specs

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Jason A. Donenfeld
On Tue, Feb 11, 2014 at 5:01 PM, Dave Reisner d...@falconindy.com wrote: systemd is already capable of setting up /run on its own: http://cgit.freedesktop.org/systemd/systemd/tree/src/core/mount-setup.c#n69 You appear to be right. In that case should the spec [1] be amended to remove this

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Jason A. Donenfeld
On Tue, Feb 11, 2014 at 5:01 PM, Dave Reisner d...@falconindy.com wrote: Strange name. I can't find one thing which I find better about this project compared to the more well-known initramfs creation tools. I'd appreciate it if you kept the antagonism to a minimum. It adds nothing to the

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Dave Reisner
On Tue, Feb 11, 2014 at 05:09:49PM +0100, Jason A. Donenfeld wrote: On Tue, Feb 11, 2014 at 5:01 PM, Dave Reisner d...@falconindy.com wrote: systemd is already capable of setting up /run on its own: http://cgit.freedesktop.org/systemd/systemd/tree/src/core/mount-setup.c#n69 You appear to

Re: [systemd-devel] [PATCH] crash on suspend/resume ...

2014-02-11 Thread Zbigniew Jędrzejewski-Szmek
On Tue, Feb 11, 2014 at 03:57:36PM +, Michael Meeks wrote: (gdb) down #4 __strnlen_sse2 () at ../sysdeps/i386/i686/multiarch/strlen-sse2.S:125 125 pcmpeqb (%eax), %xmm0 an inlined strlen. All of the interesting process_string_arg variables are 'optimized out'

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Jason A. Donenfeld
On Tue, Feb 11, 2014 at 5:15 PM, Dave Reisner d...@falconindy.com wrote: I don't think there's any change needed here. The interface states: The initrd should mount /run as a tmpfs. And sure enough, this isn't a requirement, but there's many valid reasons to do this. Ahh, okay. I suppose

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Lennart Poettering
On Tue, 11.02.14 17:20, Jason A. Donenfeld (ja...@zx2c4.com) wrote: On Tue, Feb 11, 2014 at 5:15 PM, Dave Reisner d...@falconindy.com wrote: I don't think there's any change needed here. The interface states: The initrd should mount /run as a tmpfs. And sure enough, this isn't a

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Andrey Borzenkov
В Tue, 11 Feb 2014 17:20:15 +0100 Jason A. Donenfeld ja...@zx2c4.com пишет: On Tue, Feb 11, 2014 at 5:15 PM, Dave Reisner d...@falconindy.com wrote: I don't think there's any change needed here. The interface states: The initrd should mount /run as a tmpfs. And sure enough, this

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Andrey Borzenkov
В Tue, 11 Feb 2014 17:25:29 +0100 Lennart Poettering lenn...@poettering.net пишет: An initrd without /run is mostly pointless, no? Either you have storage daemons and hence need /run around, or you don't have storage daemons, in which case you can just boot without involving any initrd?

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Reindl Harald
Am 11.02.2014 17:29, schrieb Andrey Borzenkov: В Tue, 11 Feb 2014 17:20:15 +0100 Jason A. Donenfeld ja...@zx2c4.com пишет: On Tue, Feb 11, 2014 at 5:15 PM, Dave Reisner d...@falconindy.com wrote: I don't think there's any change needed here. The interface states: The initrd should

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Dave Reisner
On Tue, Feb 11, 2014 at 08:32:29PM +0400, Andrey Borzenkov wrote: В Tue, 11 Feb 2014 17:25:29 +0100 Lennart Poettering lenn...@poettering.net пишет: An initrd without /run is mostly pointless, no? Either you have storage daemons and hence need /run around, or you don't have storage

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Jason A. Donenfeld
On Tue, Feb 11, 2014 at 5:25 PM, Lennart Poettering lenn...@poettering.net wrote: An initrd without /run is mostly pointless, no? Either you have storage daemons and hence need /run around, or you don't have storage daemons, in which case you can just boot without involving any initrd? In my

Re: [systemd-devel] [PATCH] crash on suspend/resume ...

2014-02-11 Thread Cristian Rodríguez
El 11/02/14 13:16, Zbigniew Jędrzejewski-Szmek escribió: On Tue, Feb 11, 2014 at 03:57:36PM +, Michael Meeks wrote: (gdb) down #4 __strnlen_sse2 () at ../sysdeps/i386/i686/multiarch/strlen-sse2.S:125 125 pcmpeqb (%eax), %xmm0 an inlined strlen. All of the

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Colin Guthrie
'Twas brillig, and Reindl Harald at 11/02/14 16:34 did gyre and gimble: Am 11.02.2014 17:29, schrieb Andrey Borzenkov: В Tue, 11 Feb 2014 17:20:15 +0100 Jason A. Donenfeld ja...@zx2c4.com пишет: On Tue, Feb 11, 2014 at 5:15 PM, Dave Reisner d...@falconindy.com wrote: I don't think

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Lennart Poettering
On Tue, 11.02.14 18:08, Jason A. Donenfeld (ja...@zx2c4.com) wrote: On Tue, Feb 11, 2014 at 5:25 PM, Lennart Poettering lenn...@poettering.net wrote: An initrd without /run is mostly pointless, no? Either you have storage daemons and hence need /run around, or you don't have storage

Re: [systemd-devel] Undefined reference efi_loader_get_boot_usec

2014-02-11 Thread Lennart Poettering
On Tue, 11.02.14 09:56, Cristian Rodríguez (crrodrig...@opensuse.org) wrote: El 11/02/14 09:12, Allmeroth, Robert escribió: Hi, While crosscompiling to an embedded system I got the following error: systemd-208/.libs/libudev.so: undefined reference to `efi_loader_get_boot_usec' Ok,

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Dave Reisner
On Tue, Feb 11, 2014 at 05:25:19PM +, Colin Guthrie wrote: 'Twas brillig, and Reindl Harald at 11/02/14 16:34 did gyre and gimble: Am 11.02.2014 17:29, schrieb Andrey Borzenkov: В Tue, 11 Feb 2014 17:20:15 +0100 Jason A. Donenfeld ja...@zx2c4.com пишет: On Tue, Feb 11, 2014 at

Re: [systemd-devel] [PATCH] pager: remove --no-init setting from LESS options

2014-02-11 Thread Lennart Poettering
On Tue, 11.02.14 05:55, Jason A. Donenfeld (ja...@zx2c4.com) wrote: I use konsole. It has a nice feature that when the scrollbars have been disabled -- like in the case of a full-console app like vim or less -- it makes the mouse wheel send up and down key strokes, so that scrolling happens.

Re: [systemd-devel] [PATCH] pager: remove --no-init setting from LESS options

2014-02-11 Thread Lennart Poettering
On Tue, 11.02.14 10:09, Andrey Borzenkov (arvidj...@gmail.com) wrote: On Tue, Feb 11, 2014 at 9:15 AM, Mantas Mikulėnas graw...@gmail.com wrote: On Feb 11, 2014 7:02 AM, Jason A. Donenfeld ja...@zx2c4.com wrote: I use konsole. It has a nice feature that when the scrollbars have been

Re: [systemd-devel] [PATCH] pager: remove --no-init setting from LESS options

2014-02-11 Thread Lennart Poettering
On Tue, 11.02.14 16:23, Jason A. Donenfeld (ja...@zx2c4.com) wrote: On Tue, Feb 11, 2014 at 7:09 AM, Andrey Borzenkov arvidj...@gmail.com wrote: Should not it simply respect existing LESS value? Or, for that matter, SYSTEMD_LESS if someone thinks of a good reason to have different

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Jason A. Donenfeld
On Tue, Feb 11, 2014 at 6:25 PM, Colin Guthrie gm...@colin.guthr.ie wrote: As has been mentioned elsewhere on this thread, there are a number of gotchas and corner cases, that this mechanism solved, even in the cases of things working. In my case, I'm just using devtmpfs and cryptsetup, and

Re: [systemd-devel] [PATCH] STACK (http://css.csail.mit.edu/stack/) found issues for unstable optimized code again.

2014-02-11 Thread Lennart Poettering
On Fri, 07.02.14 16:39, Stefan Beller (stefanbel...@googlemail.com) wrote: The first problem arises in src/gudev/gudevdevice.c In lines 688 and 882 we call the function split_at_whitespace, which is just a wrapper around g_strsplit_set, but removes also the empty strings. Now in this

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Jason A. Donenfeld
On Tue, Feb 11, 2014 at 5:25 PM, Lennart Poettering lenn...@poettering.net wrote: Hmm, so how do you wait for the LUKS device to show up? You need something like udev around, which uses /run... And AFAIR the DM userspace does keep some runtime state around, and that one probably wants to

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Lennart Poettering
On Tue, 11.02.14 19:53, Jason A. Donenfeld (ja...@zx2c4.com) wrote: On Tue, Feb 11, 2014 at 5:25 PM, Lennart Poettering lenn...@poettering.net wrote: Hmm, so how do you wait for the LUKS device to show up? You need something like udev around, which uses /run... And AFAIR the DM

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Jason A. Donenfeld
On Tue, Feb 11, 2014 at 7:56 PM, Lennart Poettering lenn...@poettering.net wrote: devtmpfs does not give you notifications when devices appear. If you want to generically wait for the right LUKS device to show up, you need something like udev in the mix, which provides you with notifications

Re: [systemd-devel] [PATCH] pager: remove --no-init setting from LESS options

2014-02-11 Thread Jason A. Donenfeld
On Tue, Feb 11, 2014 at 6:40 PM, Lennart Poettering lenn...@poettering.net wrote: I think adding support for $SYSTEMD_LESS which is copied to $LESS right before invoking less would be a good choice, since it would allow people to override whatever systemd tries to set. So something along the

Re: [systemd-devel] /run needs to be mounted? ugh.

2014-02-11 Thread Colin Guthrie
'Twas brillig, and Jason A. Donenfeld at 11/02/14 18:49 did gyre and gimble: On Tue, Feb 11, 2014 at 6:25 PM, Colin Guthrie gm...@colin.guthr.ie wrote: As has been mentioned elsewhere on this thread, there are a number of gotchas and corner cases, that this mechanism solved, even in the cases

Re: [systemd-devel] [PATCH] pager: remove --no-init setting from LESS options

2014-02-11 Thread Lennart Poettering
On Tue, 11.02.14 20:05, Jason A. Donenfeld (ja...@zx2c4.com) wrote: On Tue, Feb 11, 2014 at 6:40 PM, Lennart Poettering lenn...@poettering.net wrote: I think adding support for $SYSTEMD_LESS which is copied to $LESS right before invoking less would be a good choice, since it would allow

Re: [systemd-devel] [BUG] sd-bus: ObjectManager.InterfacesAdded() and fdo.DBus interfaces

2014-02-11 Thread Lennart Poettering
On Mon, 10.02.14 16:38, David Herrmann (dh.herrm...@gmail.com) wrote: Hi I stumbled over this when trying to use the ObjectManager interface with sd-bus. Whenever I add new objects, I'm supposed to advertise them with all supported interfaces. However, sd-bus implements the

Re: [systemd-devel] [PATCH] logind: use session_get_state() to get sessions state of the user

2014-02-11 Thread Lennart Poettering
On Sat, 08.02.14 20:51, Djalal Harouni (tix...@opendz.org) wrote: In function user_get_state() remove the session_is_active() check, just count on the session_get_state() function to get the correct session state. session_is_active() may return true before starting the session scope and

Re: [systemd-devel] [PATCH] logind: just call user_stop() if user_check_gc() returns false

2014-02-11 Thread Lennart Poettering
On Sat, 08.02.14 19:20, Djalal Harouni (tix...@opendz.org) wrote: Currently if the user logs out, the GC may never call user_stop(), this will not terminate the systemd user and (sd-pam) of that user. To fix this, remove the USER_CLOSING state check that is blocking the GC from calling

Re: [systemd-devel] [PATCH] logind: always kill session when termination is requested

2014-02-11 Thread Lennart Poettering
On Sat, 08.02.14 20:48, Zbigniew Jędrzejewski-Szmek (zbys...@in.waw.pl) wrote: This patch looks good! Please push! KillUserProcesses=yes/no should be ignored when termination is explicitly requested. --- This goes on top of * logind: use session_get_state() to get sessions state of the user

[systemd-devel] [PATCH v2 2/2] syscallfilter: port to libseccomp

2014-02-11 Thread Ronny Chevalier
--- Makefile.am| 30 ++--- README | 1 + TODO | 1 - configure.ac | 14 ++ man/systemd.exec.xml | 18 +++- src/core/build.h | 8 +++- src/core/dbus-execute.c|

Re: [systemd-devel] [PATCH 2/2] syscallfilter: port to libseccomp

2014-02-11 Thread Ronny Chevalier
2014-02-04 Lennart Poettering lenn...@poettering.net: So yeah, I figure we should continue with this logic, and of course probably document it... So I sent the new patch, it works the same way. But I did not use an integer array like you said. I used a set to store the syscalls number and a

Re: [systemd-devel] [PATCH] logind: just call user_stop() if user_check_gc() returns false

2014-02-11 Thread Djalal Harouni
On Tue, Feb 11, 2014 at 08:38:48PM +0100, Lennart Poettering wrote: On Sat, 08.02.14 19:20, Djalal Harouni (tix...@opendz.org) wrote: Currently if the user logs out, the GC may never call user_stop(), this will not terminate the systemd user and (sd-pam) of that user. To fix this,

Re: [systemd-devel] [PATCH 2/2] syscallfilter: port to libseccomp

2014-02-11 Thread Ronny Chevalier
2014-02-11 23:14 GMT+01:00 Ronny Chevalier chevalier.ro...@gmail.com: 2014-02-04 Lennart Poettering lenn...@poettering.net: So yeah, I figure we should continue with this logic, and of course probably document it... So I sent the new patch, it works the same way. But I did not use an integer

[systemd-devel] [PATCH v2] logind: make sure to terminate systemd user on logouts

2014-02-11 Thread Djalal Harouni
Currently if the user logs out, the GC may never call user_stop(), this will not terminate the systemd user and (sd-pam) of that user. To fix this, remove the USER_CLOSING state check that is blocking the GC from calling user_stop(). Since if user_check_gc() returns false this means that all the

[systemd-devel] [PATCH v3 2/2] syscallfilter: port to libseccomp

2014-02-11 Thread Ronny Chevalier
--- Ok so I found the problem. I forgot a condition in SET_FOREACH that if e is 0, it will stop the foreach (and read have the id 0) Here is the new patch fixing this. Sorry again Makefile.am| 30 ++--- README | 1 + TODO

[systemd-devel] How to prevent sleep during running oneshot units

2014-02-11 Thread Kai Krakow
Hey there! I've got a daily backup job scheduled using a timer unit and a oneshot service file. This backup takes around 2-4 hours. It's using rsync and syncs from btrfs HDD to a snapshotted btrfs on USB with inplace deltas. I'm mentioning this because it may matter. I've also set my system

Re: [systemd-devel] How to prevent sleep during running oneshot units

2014-02-11 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Feb 12, 2014 at 01:30:59AM +0100, Kai Krakow wrote: Hey there! Hey! There may be a bug here, because almost every time when that happened it looks like systemd has suspended my network connection but didn't bring it back online after the system refused to go to sleep. I need to

Re: [systemd-devel] How to prevent sleep during running oneshot units

2014-02-11 Thread Kai Krakow
Zbigniew Jędrzejewski-Szmek zbys...@in.waw.pl schrieb: There may be a bug here, because almost every time when that happened it looks like systemd has suspended my network connection but didn't bring it back online after the system refused to go to sleep. I need to restart NetworkManager then

Re: [systemd-devel] How to prevent sleep during running oneshot units

2014-02-11 Thread Mirco Tischler
Am 12.02.2014 01:31 schrieb Kai Krakow hurikha...@gmail.com: Hey there! Hey I've got a daily backup job scheduled using a timer unit and a oneshot service file. This backup takes around 2-4 hours. It's using rsync and syncs from btrfs HDD to a snapshotted btrfs on USB with inplace deltas.

[systemd-devel] [PATCH] pager: support SYSTEMD_LESS environment variable

2014-02-11 Thread Jason A. Donenfeld
This allows customization of the arguments used by less. The main motivation is that some folks might not like having --no-init on every invocation of less. --- If you'd like me to update some documentation, let me know what files I should edit, and I'll send a v2. src/shared/pager.c | 17

Re: [systemd-devel] [PATCH] pager: support SYSTEMD_LESS environment variable

2014-02-11 Thread Lennart Poettering
On Wed, 12.02.14 02:58, Jason A. Donenfeld (ja...@zx2c4.com) wrote: This allows customization of the arguments used by less. The main motivation is that some folks might not like having --no-init on every invocation of less. --- If you'd like me to update some documentation, let me know what

Re: [systemd-devel] [PATCH] pager: support SYSTEMD_LESS environment variable

2014-02-11 Thread Lennart Poettering
On Wed, 12.02.14 03:10, Lennart Poettering (lenn...@poettering.net) wrote: On Wed, 12.02.14 02:58, Jason A. Donenfeld (ja...@zx2c4.com) wrote: This allows customization of the arguments used by less. The main motivation is that some folks might not like having --no-init on every

[systemd-devel] [PATCH v2] pager: support SYSTEMD_LESS environment variable

2014-02-11 Thread Jason A. Donenfeld
This allows customization of the arguments used by less. The main motivation is that some folks might not like having --no-init on every invocation of less. --- man/journalctl.xml | 4 man/localectl.xml | 4 man/loginctl.xml| 4 man/machinectl.xml | 4

Re: [systemd-devel] How to prevent sleep during running oneshot units

2014-02-11 Thread Andrey Borzenkov
В Wed, 12 Feb 2014 02:12:15 +0100 Kai Krakow hurikha...@gmail.com пишет: See systemd-inhibit(1). Yeah, I've read that of course. Maybe I didn't get the complete picture but from the man page it's supposed to work by running systemd-inhibit on the command line. This in turn means, I'd

[systemd-devel] journal on btrfs subvolume, failed unmounting /var/log/journal

2014-02-11 Thread Chris Murphy
It looks like var-log-journal.mount is called before systemd-journald is finished using it. Is the failure message merely cosmetic? The file system comes up clean on reboot so I'm pretty sure it's being cleanly unmounted despite this message. fstab UUID=-- /var/log/journal

Re: [systemd-devel] [PATCH v2] pager: support SYSTEMD_LESS environment variable

2014-02-11 Thread Zbigniew Jędrzejewski-Szmek
On Wed, Feb 12, 2014 at 03:30:10AM +0100, Jason A. Donenfeld wrote: This allows customization of the arguments used by less. The main motivation is that some folks might not like having --no-init on every invocation of less. Applied, with a slight simplification. Zbyszek