log: Open logc files with O_TRUNC

It's really confusing when one use -o option
and didn't see update on top of log file.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: Use switch in dump_chrdev

This will allow to implement tty dumping
in future.

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
dump: Don't dump file params with on-stack values

Otherwise I see output like

 | Dumping path for 1536412160 fd via self 27 [/usr/bin/screen]

where fd is taken from stack and what is worse -- we work
with root privilegues, thus dumping _anything_ from stack
is very bad idea.

With explicitly cleared stack data and FD_DESC_INVALID the
log file will have an entry like

 | Dumping path for -3 fd via self 27 [/usr/bin/screen]

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
syscall: remove unused headers

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
parasite: remove unused headers

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: set SA_RESTART for SIGIO in file_fown

Otherwise waitpid returns -EINTR and the test case fails.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: initialize shared memory before fork

Otherwise this memory are initialized from parent and child,
but parent may initialize, when a child has written a useful data.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: remove extra code from file_fown

The testcase is buggy -- the signal is delivered _before_ we checkpoint
and restore it, thus it checks nothing. But after the fix test fails,
due to bug in fowners restore. Will fix it later.

Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: open with O_CREAT in second argument needs 3 arguments

The mode argument must be supplied when O_CREAT is specified in flags.
Otherwise it will cause compile error due to -Werror is specified.

Signed-off-by: Viktor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: Need add -Wno-unused-result option lib and static Makefile

It's need to add -Wno-unused-result option to lib and
static Makefile to avoid errors like:
msg.c:58:8: error: ignoring return value of 'write', declared with
attribute warn_unused_result [-Werror=unused-result]

Signed-off-by: Victor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: Need increase buffer in msgque.c to avoid overflow

Need increase buffer in msgque.c to avoid overflow via memcpy,
because now mtext[20] less than ANOTHER_TEST_STRING "Yet another test sysv5 msg".

Signed-off-by: Victor Konyashkin <vkonyashkin@parallels.com>
Acked-by: Andrey Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
make: Highlight Makefile.inc absence

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
parasite: remove excessive header deps from parasite.h and friends

The task is not complete - this is just a part of what have to be done. I.e.
looks like a lot of excessive deps can be fixed.

Signed-off-by: Stanislav Kinsbursky <skinsbursky@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
zdtm: Update file_fown test case

 - make sure syscalls finished with success
 - put sync points where needed

Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>